eris.allocator

Custom memory allocators and related helpers.

Based on std.experimental.allocator, without being strictly compatible.

Members

Functions

dispose
void dispose(Allocator alloc, T* p)
void dispose(Allocator alloc, T[] array)

Destroy and deallocate a given object/array.

make
T* make(Allocator alloc, Args args)

Allocate and construct an object of the specified type.

makeArray
T[] makeArray(Allocator alloc, size_t length, T init)

Make an array of the specified type.

Interfaces

Allocator
interface Allocator

Base allocator interface.

Structs

Mallocator
struct Mallocator

C stdlib allocator using malloc and free.

Variables

isAllocator
enum bool isAllocator(T);

Static interface counterpart of Allocator.

platformAlignment
enum uint platformAlignment;

Alignment large enough for any scalar type.