add ArrayList alias to std

This commit is contained in:
2026-07-13 13:46:45 +02:00
parent 288df082e2
commit 6455df52b4
14 changed files with 600 additions and 13 deletions
+3 -3
View File
@@ -61,7 +61,7 @@ alloc func($T type, allocator Allocator, count usize) []mut T ! AllocError {
if element_size == 0 {
return _empty_slice(T, count)
}
if count > max_value(usize) / element_size {
if count > div_trunc(max_value(usize), element_size) {
return .out_of_memory
}
@@ -86,7 +86,7 @@ realloc func($T type, allocator Allocator, memory []mut T, new_count usize) []mu
if element_size == 0 {
return _empty_slice(T, new_count)
}
if new_count > max_value(usize) / element_size {
if new_count > div_trunc(max_value(usize), element_size) {
return .out_of_memory
}
@@ -125,7 +125,7 @@ _power_of_two func(value usize) bool {
current usize = value
while current > 1 {
half usize = current / 2
half usize = div_trunc(current, 2)
if half * 2 != current {
return false
}