HmodBlockAllocator

A somewhat incomplete (no dealloc) std.allocator implementation - passed to libdparse.

All data is deallocated in destructor.

Allocates memory in fixed-size blocks and tries to place allocations into those blocks. Allocations larger than a block fail.

Based on BlockAllocator from Brian Schott's containers library

Destructor

~this
~this()

Frees all memory allocated by this allocator

Postblit

this(this)
this(this)

Copy construction disabled because this struct clears its memory with a destructor.

Members

Aliases

bytesHighTide
alias bytesHighTide = bytesAllocated

The highest number of bytes allocated at any given moment.

Functions

allocate
void[] allocate(size_t bytes)

Standard allocator operation.

deallocate
bool deallocate(void[] b)

Dummy deallocation function, to keep track of how much the user tried to deallocate.

owns
Ternary owns(void[] b)

Was the given buffer allocated with this allocator?

writeStats
void writeStats()

Write allocation statistics to standard output.

Manifest constants

alignment
enum alignment;

Allocator's memory alignment

maxAllocationSize
enum maxAllocationSize;

The maximum number of bytes that can be allocated at a time with this allocator. This is smaller than blockSize because of some internal bookkeeping information.

Unions

__anonymous
union __anonymous
Undocumented in source.
__anonymous
union __anonymous
Undocumented in source.
__anonymous
union __anonymous
Undocumented in source.
__anonymous
union __anonymous
Undocumented in source.
__anonymous
union __anonymous
Undocumented in source.

Meta