List capacity and SubProcess field name change (#1038)

* std::collections::list: adjust increased capacity
* std::os::process: rename conflicting field in SubProcess
* c3c: adjust spacing for --list-builtins and --list-keywords
This commit is contained in:
Pierre Curto
2023-10-09 12:52:23 +02:00
committed by GitHub
parent 3f77e868b1
commit 6b571fe427
3 changed files with 5 additions and 5 deletions

View File

@@ -352,11 +352,11 @@ fn void List.set(&self, usz index, Type value) @operator([]=)
fn void List.ensure_capacity(&self, usz added = 1) @inline @private
{
usz new_size = self.size + added;
if (self.capacity > new_size) return;
if (self.capacity >= new_size) return;
assert(new_size < usz.max / 2U);
usz new_capacity = self.capacity ? 2U * self.capacity : 16U;
while (new_size >= new_capacity) new_capacity *= 2U;
while (new_capacity < new_size) new_capacity *= 2U;
self.reserve(new_capacity);
}

View File

@@ -455,7 +455,7 @@ fn usz! SubProcess.read_stderr(&self, char* buffer, usz size)
$endif
}
fn bool! SubProcess.is_alive(&self)
fn bool! SubProcess.is_running(&self)
{
if (!self.is_alive) return false;
$if env::WIN32: