std.experimental.allocator.gc_allocator

D's built-in garbage-collected allocator.

Source: std/experimental/allocator/_gc_allocator.d

Types 1

D's built-in garbage-collected allocator.

Fields
uint alignmentThe alignment is a static constant equal to `platformAlignment`, which ensures proper alignment for any D data type.
GCAllocator instanceReturns the global instance of this allocator type. The garbage collected allocator is thread-safe, therefore all of its methods and `instance` itself are `shared`.
Methods
void[] allocate(size_t bytes) pure nothrow @trusted shared constStandard 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.
bool expand(ref void[] b, size_t delta) pure nothrow @trusted shared constDitto
bool reallocate(ref void[] b, size_t newSize) pure nothrow @system shared constDitto
Ternary resolveInternalPointer(const void * p, ref void[] result) pure nothrow @trusted @nogc shared constDitto
bool deallocate(void[] b) pure nothrow @system @nogc shared constDitto
size_t goodAllocSize(size_t n) pure nothrow @safe @nogc shared constDitto
void[] allocateZeroed()(size_t bytes) pure nothrow @trusted shared const
void collect() nothrow @trusted shared const