Crate memalloc [] [src]

memalloc

Memory allocation in stable rust, providing a similar interface to std::rt::heap, notably these functions align everything according to the alignment of u8, rather than using a user-provided alignment.

Additionally, they do not allow for handling allocation failure, and will simply abort the process on OOM. Unfortunately, this limitation is unavoidable if we want to use only stable APIs.

Functions

allocate

Returns a pointer to size bytes of memory aligned to mem::align_of::<u8>().

deallocate

Deallocates the memory referenced by ptr.

empty

A token empty allocation which cannot be read from or written to, but which can be used as a placeholder when a 0-sized allocation is required.

reallocate

Resizes the allocation referenced by ptr to new_size bytes.