Mallocator

Wrapper for $(D_PSYMBOL malloc)/$(D_PSYMBOL realloc)/$(D_PSYMBOL free) from the C standard library.

Members

Functions

allocate
void[] allocate(size_t size)

Allocates size bytes of memory.

deallocate
bool deallocate(void[] p)

Deallocates a memory block.

reallocate
bool reallocate(void[] p, size_t size)

Increases or decreases the size of a memory block.

reallocateInPlace
bool reallocateInPlace(void[] p, size_t size)

Reallocating in place isn't supported.

Properties

alignment
uint alignment [@property getter]
instance
shared(Mallocator) instance [@property getter]

Static allocator instance and initializer.

Inherited Members

From Allocator

alignment
uint alignment [@property getter]
allocate
void[] allocate(size_t size)

Allocates size bytes of memory.

deallocate
bool deallocate(void[] p)

Deallocates a memory block.

reallocate
bool reallocate(void[] p, size_t size)

Increases or decreases the size of a memory block.

reallocateInPlace
bool reallocateInPlace(void[] p, size_t size)

Reallocates a memory block in place if possible or returns $(D_KEYWORD false). This function cannot be used to allocate or deallocate memory, so if p is $(D_KEYWORD null) or size is 0, it should return $(D_KEYWORD false).

Meta