whole-function comptime folding for zero-runtime value calls

This commit is contained in:
2026-07-22 23:11:48 +02:00
parent 21ff291788
commit 8b50eb7606
24 changed files with 564 additions and 260 deletions
+32
View File
@@ -0,0 +1,32 @@
import "@std/mem"
import "@std/testing"
handles_append test {
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
try append(&list, 42)
try testing.expect_equal(1, list.items.len)
try testing.expect_equal(42, list.items[0])
}
handles_clear test {
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
try append(&list, 42)
clear(&list)
try testing.expect_equal(0, list.items.len)
}
handles_reserve test {
list ArrayList(i32) = init(mem.c_allocator)
defer deinit(&list)
try reserve(&list, 10)
try testing.expect_equal(10, list.capacity)
try testing.expect_equal(0, list.items.len)
}