Default_Allocator module

usable_size

procedureSource

Returns how many bytes the allocation at ptr can hold, which can exceed what was asked for. Returns 0 for null.

Example↗
memory := allocator_proc(.ALLOCATE, 10, 0, null, null);
assert(usable_size(memory) >= 10);
allocator_proc(.FREE, 0, 10, memory, null);
usable_size :: (ptr: *void) -> s64

Parameters

ptr: *void

Returns

s64

See also