|
x-engine-c v0.2.13
The C engine for x-lang
|
Heap management and mark-sweep garbage collection. More...
#include "x-base.h"Go to the source code of this file.
Heap management and mark-sweep garbage collection.
Provides functions for marking reachable objects and sweeping unreachable ones. Requires X_HEAP to be defined.
Objects are linked into a singly-linked heap chain via x_obj_heap(). The GC lifecycle is:
Rooting rules – an object survives GC if any of these apply:
A C local holding the only reference to a heap object is NOT a root by itself: the frame must register it (see the root chain below).
Objects not reachable by any of the above are collected during sweep.
., .,
{O,O}
( )
" "