Standard allocator methods per the semantics defined above. The deallocate and reallocate methods are @system because they 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.
The alignment is a static constant equal to platformAlignment, which ensures proper alignment for any D data type.
Returns the global instance of this allocator type. The C heap allocator is thread-safe, therefore all of its methods are static and instance itself is shared.
auto buffer = Mallocator.instance.allocate(1024 * 1024 * 4); scope(exit) Mallocator.instance.deallocate(buffer); //...
The C heap allocator.