add dynamic array init
This commit is contained in:
parent
72a24efd32
commit
bcaa847501
1 changed files with 4 additions and 0 deletions
|
|
@ -1,5 +1,9 @@
|
|||
// @todo(judah): replace array_add
|
||||
|
||||
init :: inline (arr: *[..]$T, allocator: Allocator) {
|
||||
arr.allocator = allocator;
|
||||
}
|
||||
|
||||
append :: inline (arr: *[..]$T, value: T) -> *T {
|
||||
ptr := basic.array_add(arr,, allocator = arr.allocator);
|
||||
ptr.* = value;
|
||||
|
|
|
|||
Loading…
Reference in a new issue