CPUMallocator

struct CPUMallocator {
Opt opt;
enum deviceof;
enum pinned;
enum instance;
}

Alias This

opt

Members

Functions

allocate
void[] allocate(size_t bytes)
deallocate
bool deallocate(void[] b)

Standard allocator methods per the semantics defined above. The deallocate method is @system because it may move memory around, leaving dangling pointers in user code. Somewhat paradoxically, malloc is @safe but that's only useful to safe programs that can afford to leak memory allocated.

Meta