core.internal.gc.impl.manual.gc
This module contains a minimal garbage collector implementation according to published requirements. This library is mostly intended to serve as an example, but it is usable in applications which do not rely on a garbage collector to clean up memory (ie. when dynamic array resizing is not used, and all memory allocated with 'new' is freed deterministically with 'delete').
Please note that block attribute data must be tracked, or at a minimum, the FINALIZE bit must be tracked for any allocated memory block because calling rt_finalize on a non-object block can result in an access violation. In the allocator below, this tracking is done via a leading uint bitmask. A real allocator may do better to store this data separately, similar to the basic GC.
Copyright
Types 1
void enable()void disable()void collect() nothrowvoid minimize() nothrowuint getAttr(void * p) nothrowuint setAttr(void * p, uint mask) nothrowuint clrAttr(void * p, uint mask) nothrowsize_t reserve(size_t size) nothrowvoid * addrOf(void * p) nothrow @nogcDetermine the base address of the block containing p. If p is not a gc allocated pointer, return null.size_t sizeOf(void * p) nothrow @nogcDetermine the allocated size of pointer p. If p is an interior pointer or not a gc allocated pointer, return 0.BlkInfo query(void * p) nothrowDetermine the base address of the block containing p. If p is not a gc allocated pointer, return null.core.memory.GC.Stats stats() nothrowcore.memory.GC.ProfileStats profileStats() nothrowint rootsApply(scope int delegate(ref Root) nothrow dg)int rangesApply(scope int delegate(ref Range) nothrow dg)void runFinalizers(const scope void[] segment) nothrowbool inFinalizer() nothrowulong allocatedInCurrentThread() nothrowvoid[] getArrayUsed(void * ptr, bool atomic = false) nothrowbool shrinkArrayUsed(void[] slice, size_t existingUsed, bool atomic = false) nothrowthis()Functions 4
noreturn onOutOfMemoryError(void * pretend_sideffect = null, string file = __FILE__, size_t line = __LINE__) @trusted pure nothrow @nogcvoid _d_register_manual_gc()