GCAllocator;auto buffer =GCAllocator.instance.allocate(1024 * 1024 * 4);// deallocate upon scope's end (alternatively: leave it to collection)scope(exit)GCAllocator.instance.deallocate(buffer);//...
alignment;allocate(size_tbytes) shared const;expand(ref void[]b, size_tdelta) shared const;reallocate(ref void[]b, size_tnewSize) shared const;resolveInternalPointer(const void*p, ref void[]result) shared const;deallocate(void[]b) shared const;goodAllocSize(size_tn) shared const;reallocate methods are@system because they may move memory around, leaving dangling pointers in user code.instance;instance itself areshared.