Expand description
Exposes Mun garbage collection.
Structs§
- GcPtr
- A
GcPtris what you interact with outside of the allocator. It is a pointer to a piece of memory that points to the actual data stored in memory.
Functions§
- mun_
gc_ ⚠alloc - Allocates an object in the runtime of the given
ty. If successful,objis set, otherwise a non-zero error handle is returned. - mun_
gc_ ⚠collect - Collects all memory that is no longer referenced by rooted objects. If successful,
reclaimedis set, otherwise a non-zero error handle is returned. Ifreclaimedistrue, memory was reclaimed, otherwise nothing happend. This behavior will likely change in the future. - mun_
gc_ ⚠ptr_ type - Retrieves the
tyfor the specifiedobjfrom the runtime. If successful,tyis set, otherwise a non-zero error handle is returned. - mun_
gc_ ⚠root - Roots the specified
obj, which keeps it and objects it references alive. Objects marked as root, must callmun_gc_unrootbefore they can be collected. An object can be rooted multiple times, but you must make sure to callmun_gc_unrootan equal number of times before the object can be collected. If successful,objhas been rooted, otherwise a non-zero error handle is returned. - mun_
gc_ ⚠unroot - Unroots the specified
obj, potentially allowing it and objects it references to be collected. An object can be rooted multiple times, so you must make sure to callmun_gc_unrootthe same number of times asmun_gc_rootwas called before the object can be collected. If successful,objhas been unrooted, otherwise a non-zero error handle is returned.