Fields
alloc: *const fn (*anyopaque, usize, u8, usize) ?[*]u8,
Attempt to allocate exactly len
bytes aligned to 1 << ptr_align
.
ret_addr
is optionally provided as the first return address of the allocation call stack. If the value is 0
it means no return address has been provided.
resize: *const fn (*anyopaque, []u8, u8, usize, usize) bool,
Attempt to expand or shrink memory in place. buf.len
must equal the length requested from the most recent successful call to alloc
or resize
. buf_align
must equal the same value that was passed as the ptr_align
parameter to the original alloc
call.
A result of true
indicates the resize was successful and the allocation now has the same address but a size of new_len
. false
indicates the resize could not be completed without moving the allocation to a different address.
new_len
must be greater than zero.
ret_addr
is optionally provided as the first return address of the allocation call stack. If the value is 0
it means no return address has been provided.
free: *const fn (*anyopaque, []u8, u8, usize) void,
Free and invalidate a buffer.
buf.len
must equal the most recent length returned by alloc
or given to a successful resize
call.
buf_align
must equal the same value that was passed as the ptr_align
parameter to the original alloc
call.
ret_addr
is optionally provided as the first return address of the allocation call stack. If the value is 0
it means no return address has been provided.