core.gc.gcinterface
Contains the internal GC interface.
Copyright
Copyright Digital Mars 2016.
Types 7
aliasBlkAttr = core.memory.GC.BlkAttr
aliasBlkInfo = core.memory.GC.BlkInfo
aliasRootIterator = int delegate(scope int delegate(ref Root) nothrow dg)
aliasRangeIterator = int delegate(scope int delegate(ref Range) nothrow dg)
structRoot
Fields
void * prootstructRange
interfaceGC
Methods
void enable()void disable()void collect() nothrow;uint getAttr(void * p) nothrow;uint setAttr(void * p, uint mask) nothrow;uint clrAttr(void * p, uint mask) nothrow;size_t extend(void * p, size_t minsize, size_t maxsize, const TypeInfo ti) nothrow;Attempt to in-place enlarge the memory block pointed to by p by at least minsize bytes, up to a maximum of maxsize additional bytes. This does not attempt to move the memory block (like realloc() d...size_t reserve(size_t size) nothrow;void * 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) nothrow;Determine the base address of the block containing p. If p is not a gc allocated pointer, return null.core.memory.GC.Stats stats() @safe nothrow @nogcRetrieve statistics about garbage collection. Useful for debugging and tuning.core.memory.GC.ProfileStats profileStats() @safe nothrow @nogcRetrieve profile statistics about garbage collection. Useful for debugging and tuning.ulong allocatedInCurrentThread() nothrow;Returns the number of bytes allocated for the current thread since program start. It is the same as GC.stats().allocatedInCurrentThread, but faster.void[] getArrayUsed(void * ptr, bool atomic = false) nothrow;Get the current used capacity of an array block.bool expandArrayUsed(void[] slice, size_t newUsed, bool atomic = false) nothrow @safeExpand the array used size in place.size_t reserveArrayCapacity(void[] slice, size_t request, bool atomic = false) nothrow @safeExpand the array capacity in place.bool shrinkArrayUsed(void[] slice, size_t existingUsed, bool atomic = false) nothrow;Shrink used space of a slice in place.void initThread(ThreadBase thread) nothrow @nogcPrepare a thread for use with the GC after the GC is initialized. Note that you can register an initThread function to call before the GC is initialized, see core.gc.registry.void cleanupThread(ThreadBase thread) nothrow @nogcClean up any GC related data from the thread before it exits. There is no equivalent of this function as a hook before the GC is initialized. That is, the thread init function called before the GC ...