MergedAllocation

Allows to merge the allocation of several arrays, which saves allocation count and can speed up things thanks to locality.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

alloc
void alloc(T* array, size_t numElems, size_t alignment)

Allocate (or count) space needed for numElems elements of type T with given alignment. This gets called twice for each array, see example for usage.

allocArray
void allocArray(T[] array, size_t numElems, size_t alignment)

Allocate (or count) space needed for numElems elements of type T with given alignment. This gets called twice for each array, see example for usage.

allocate
void allocate()

Allocate actual storage for the merged allocation. From there, you need to define exactly the same area with alloc and allocArray. This time they will get a proper value.

start
void start()

Start defining the area of allocations.

Manifest constants

SENTINEL_BYTES
enum SENTINEL_BYTES;
Undocumented in source.
maxExpectedAlignment
enum maxExpectedAlignment;
Undocumented in source.

Examples

see below unittest.

Meta