Cyclone Scheme  0.5

◆ gc_sweep()

size_t gc_sweep ( gc_heap h,
int  heap_type,
size_t *  sum_freed_ptr,
gc_thread_data thd 
)

Sweep portion of the GC algorithm.

Parameters
hHeap to sweep
heap_typeType of heap, based on object sizes allocated on it
sum_freed_ptrOut parameter tracking the sum of freed data, in bytes. This parameter is ignored if NULL is passed.
thdThread data object for the mutator using this heap
Returns
Return the size of the largest object freed, in bytes

This portion of the major GC algorithm is responsible for returning unused memory slots to the heap. It is only called by the collector thread after the heap has been traced to identify live objects.