Allocator.allocate

void[] allocate(size_t size, size_t alignment = (void *).sizeof * 2) const nothrow @nogc

Requests a block from the hook.

The request is valid when size is at least 1 and alignment is a power of two; anything else (a zero size, an alignment of 0 or a non-power-of-two alignment) is a request that cannot be met. Invalid requests and unsatisfiable valid ones are indistinguishable by design: callers know their sizes and skip the call for empty ones.

Parameters

sizeexact number of bytes to obtain; 0 is never served.
alignmentpower-of-two alignment of the returned address; defaults to (void*).sizeof * 2.

Returns

a slice of exactly size bytes with at least the requested

alignment and uninitialised contents, or the null slice on failure.