library/src/garbage_collection/BP_MemoryGarbageCollector.cc
// creates a new heap chunk list element
creates a new heap chunk list element
creates a new heap chunk list element
P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK BP_GarbageCollectorCreateChunk(void *ptr, size_t alloc_size, P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK first, P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK prev,P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK next)
{
	P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK chunk = (P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK) bpcalloc(sizeof(BP_GARBAGE_COLLECTOR_ALLOC_CHUNK), 1);
	chunk->chunk_ptr = ptr;
	chunk->chunk_size = alloc_size;
	chunk->first = first;
	if(first == NULL)
		chunk->first = chunk;
	chunk->prev  = prev;
	chunk->next  = next;
	return chunk;
}
P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK BP_GarbageCollectorCreateChunk ( void * ptr , size_t alloc_size , P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK first , P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK prev , P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK next ) { P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK chunk = ( P_BP_GARBAGE_COLLECTOR_ALLOC_CHUNK ) bpcalloc ( sizeof ( BP_GARBAGE_COLLECTOR_ALLOC_CHUNK ) , 1 ) ; chunk -> chunk_ptr = ptr ; chunk -> chunk_size = alloc_size ; chunk -> first = first ; if ( first == NULL ) chunk -> first = chunk ; chunk -> prev = prev ; chunk -> next = next ; return chunk ; }
creates a new heap chunk list element
creates a new heap chunk list element
// allocate new space for chunk // set pointer and size in tracker // set list pointers // return new chunk