/** * Allocates and initializes a new tree structure. * @return a pointer to the new tree structure */ Tree* TreeInitialize(int(*compare)(void*, void*, int)) { #if defined(UNIT_TESTS) Tree* newt = malloc(sizeof(Tree)); #else Tree* newt = mymalloc(__FILE__, __LINE__, sizeof(Tree)); #endif TreeInitializeNoMalloc(newt, compare); return newt; }
/** * Heap initialization. */ int Heap_initialize(void) { TreeInitializeNoMalloc(&heap, ptrCompare); heap.heap_tracking = 0; /* no recursive heap tracking! */ return 0; }