core.gc.gcinterface

Contains the internal GC interface.

Types 7

aliasRootIterator = int delegate(scope int delegate(ref Root) nothrow dg)
aliasRangeIterator = int delegate(scope int delegate(ref Range) nothrow dg)
structRoot
Fields
void * proot
structRange
Fields
void * pbot
void * ptop
Methods
bool opEquals(const scope Range rhs) nothrow const
interfaceGC
Methods
void enable()
void disable()
void collect() nothrow;
void minimize() nothrow;minimize free space usage
uint getAttr(void * p) nothrow;
uint setAttr(void * p, uint mask) nothrow;
uint clrAttr(void * p, uint mask) nothrow;
void * malloc(size_t size, uint bits, const TypeInfo ti) nothrow;
BlkInfo qalloc(size_t size, uint bits, const scope TypeInfo ti) nothrow;
void * calloc(size_t size, uint bits, const TypeInfo ti) nothrow;
void * realloc(void * p, size_t size, uint bits, const TypeInfo ti) 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 free(void * p) nothrow @nogc
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.
void addRoot(void * p) nothrow @nogcadd p to list of roots
void removeRoot(void * p) nothrow @nogcremove p from list of roots
RootIterator rootIter() @property @nogc
void addRange(void * p, size_t sz, const TypeInfo ti) nothrow @nogcadd range to scan for roots
void removeRange(void * p) nothrow @nogcremove range
RangeIterator rangeIter() @property @nogc
void runFinalizers(const scope void[] segment) nothrow;run finalizers
bool inFinalizer() nothrow @nogc @safe
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 ...