Module malloc_ms_util

Module malloc_ms_util 

Source
Expand description

Using malloc as mark sweep free-list allocator.

Functions§

align_alloc
Allocate with alignment. This also guarantees the memory is zero initialized.
align_offset_alloc
Allocate with alignment and offset. Beside returning the allocation result, this will store the malloc result at (result - BYTES_IN_ADDRESS) so we know the original malloc result.
alloc
allocate size bytes, which is aligned to align at offset return the address, and whether it is an offset allocation
free
get_malloc_usable_size
get malloc usable size of an address is_offset_malloc: whether the address is allocated with some offset
offset_free
Free an address that is allocated with an offset (returned by crate::util::malloc::malloc_ms_util::align_offset_alloc).
offset_malloc_usable_size
Get the malloc usable size for an address that is returned by crate::util::malloc::malloc_ms_util::align_offset_alloc.