-
Notifications
You must be signed in to change notification settings - Fork 20
Common Interface of all Allocators
Allocates n or more bytes. If the Allocator is out of memory it returns an empty Block.
Reallocates for the given Block b n bytes. If the reallocation was successful, then true is returned, other wise false. The pointer of b.ptr might change, but the content of min(b.length, n) bytes is preserved.
Deallocates the provided Block b and resets it.
Expands the given Block b by delta bytes. If enough contiguous memory is available, then true is returned, otherwise false. It is guaranteed that the b.ptr stays the same. (Not all Allocator implement this.)
Returns true, if the Allocator owns this Block, otherwise false. (Not all Allocator implements this.)
Frees all memory that was provided by this Allocator. (Not all Allocator implements this.) Saved client Blocks become to dangling pointers!