string pool

This commit is contained in:
2026-07-22 00:49:56 +02:00
parent 1d719c6a42
commit 596183b9a0
3 changed files with 90 additions and 5 deletions
+7
View File
@@ -62,6 +62,13 @@ append func($T type, list @mut ArrayList(T), value T) void ! mem.AllocError {
return
}
pop func($T type, list @mut ArrayList(T)) ?T {
if (list.items.len == 0) return null
value :: list.items[list.items.len - 1]
list.items = list.items.ptr[..list.items.len - 1]
return value
}
clear func($T type, list @mut ArrayList(T)) void {
list.items = list.items.ptr[..0]
}