Mallocator.allocate

Allocates size bytes of memory.

class Mallocator
@nogc nothrow pure shared @system
void[]
allocate
(
size_t size
)

Parameters

size size_t

Amount of memory to allocate.

Return Value

Type: void[]

The pointer to the new allocated memory.

Examples

auto p = Mallocator.instance.allocate(20);
assert(p.length == 20);
Mallocator.instance.deallocate(p);

p = Mallocator.instance.allocate(0);
assert(p.length == 0);

Meta