BlockAllocator

Simple allocator that allocates memory in chucks of blockSize, and then frees all of its blocks when it goes out of scope. The block allocator is reference counted, so it may be copied safely. It does not support freeing any memory allocated by it. Deallocation only occurs by destroying the entire allocator. Note that it is not possible to allocate blockSize bytes with this allocator due to some memory being used for internal record keeping.

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

Functions

allocate
void[] allocate(size_t bytes)

Standard allocator operation.

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.

Meta