add reallocarray

This commit is contained in:
Matthew 2025-09-24 05:08:38 +10:00
parent 85177acdd0
commit 27d62beb41

View File

@ -75,6 +75,13 @@ AllocArray(T)(u64 count)
return (cast(T*)mem)[0 .. count];
}
T[]
ReallocArray(T)(T[] arr, u64 count)
{
void* mem = pureRealloc(arr.ptr, T.sizeof * count);
return (cast(T*)mem)[0 .. count];
}
Arena
CreateArena(u64 size)
{