NullAllocator

NullAllocator is an emphatically empty implementation of the allocator interface. Although it has no direct use, it is useful as a "terminator" in composite allocators.

Members

Functions

alignedAllocate
void[] alignedAllocate(size_t , uint )

Always returns null.

alignedReallocate
bool alignedReallocate(void[] b, size_t , uint )

These methods return false. Precondition: b is null. This is because there is no other possible legitimate input.

allocate
void[] allocate(size_t )

Always returns null.

allocateAll
void[] allocateAll()

Always returns null.

deallocate
bool deallocate(void[] b)

No-op. Precondition: b is null

deallocateAll
bool deallocateAll()

No-op.

empty
Ternary empty()

Returns Ternary.yes.

expand
bool expand(void[] b, size_t s)

These methods return false. Precondition: b is null. This is because there is no other possible legitimate input.

owns
Ternary owns(void[] )

Returns Ternary.no.

reallocate
bool reallocate(void[] b, size_t )

These methods return false. Precondition: b is null. This is because there is no other possible legitimate input.

resolveInternalPointer
Ternary resolveInternalPointer(void* , void[] )

Returns Ternary.no.

Static variables

instance
NullAllocator instance;

Returns the shared global instance of the NullAllocator.

Variables

alignment
enum uint alignment;

NullAllocator advertises a relatively large alignment equal to 64 KB. This is because NullAllocator never actually needs to honor this alignment and because composite allocators using NullAllocator shouldn't be unnecessarily constrained.

Meta