add dynamic array init

This commit is contained in:
Judah Caruso 2025-05-27 00:52:17 -06:00
parent 72a24efd32
commit bcaa847501

View file

@ -1,5 +1,9 @@
// @todo(judah): replace array_add // @todo(judah): replace array_add
init :: inline (arr: *[..]$T, allocator: Allocator) {
arr.allocator = allocator;
}
append :: inline (arr: *[..]$T, value: T) -> *T { append :: inline (arr: *[..]$T, value: T) -> *T {
ptr := basic.array_add(arr,, allocator = arr.allocator); ptr := basic.array_add(arr,, allocator = arr.allocator);
ptr.* = value; ptr.* = value;