Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.

The array of allocators is publicly available for e.g. initialization and
inspection.

enum uint alignment;

The alignment offered is the same as Allocator.alignment.

const pure nothrow @nogc @safe size_t goodAllocSize(size_t bytes);

Rounds up to the maximum size of the bucket in which bytes falls.

void[] allocate(size_t bytes);

Directs the call to either one of the buckets allocators.

void[] alignedAllocate(size_t bytes, uint alignment);

Allocates the requested bytes of memory with specified alignment.
Directs the call to either one of the buckets allocators. Defined only
if Allocator defines alignedAllocate.

bool expand(ref void[] b, size_t delta);

This method allows expansion within the respective bucket range. It succeeds
if both b.length and b.length + delta fall in a range of the form
[min + k * step, min + (k + 1) * step - 1].

bool reallocate(ref void[] b, size_t size);

This method allows reallocation within the respective bucket range. If both
b.length and size fall in a range of the form [min + k *
step, min + (k + 1) * step - 1], then reallocation is in place. Otherwise,
reallocation with moving is attempted.

bool alignedReallocate(ref void[] b, size_t size, uint a);

Similar to reallocate, with alignment. Defined only if Allocator
defines alignedReallocate.

Ternary owns(void[] b);

Defined only if Allocator defines owns. Finds the owner of b and forwards the call to it.

bool deallocate(void[] b);

This method is only defined if Allocator defines deallocate.

bool deallocateAll();

This method is only defined if all allocators involved define deallocateAll, and calls it for each bucket in turn. Returns true if all
allocators could deallocate all.

Ternary resolveInternalPointer(const void* p, ref void[] result);

This method is only defined if all allocators involved define resolveInternalPointer, and tries it for each bucket in turn.