Cyclone Scheme  0.28.0

◆ gc_alloc()

void* gc_alloc ( gc_heap_root hrt,
size_t  size,
char *  obj,
gc_thread_data thd,
int *  heap_grown 
)

Allocate memory on the heap for an object.

Parameters
hrtThe root of the heap to allocate from
sizeSize of the object to allocate
objObject containing data to copy to the heap
thdThe requesting mutator's thread data object
heap_grownPointer to an "out" parameter that will be set to 1 if the heap is grown in size.
Returns
Pointer to the heap object

This function will attempt to grow the heap if it is full, and will terminate the program if the OS is out of memory.