/* Malloc a SarqNode function */ static SarqNode mallocSNode(void * item) { SarqNode snode = (SarqNode) mallocFunc(sizeof(struct sarqNode)); snode->item = item; snode->left = NULL; snode->right = NULL; return snode; }
void* CreateCarver( void* (*mallocFunc)(size_t size), void (*freeFunc)(void* ptr), pCarverPrintMsgFunc printMsgFunc, CarverMsgType supressMsgs, short unsigned blkSize, CarverElemSize elemSize) { pCarver newCarver = mallocFunc(sizeof *newCarver); InitCarver(newCarver, mallocFunc, freeFunc, printMsgFunc, supressMsgs, blkSize, elemSize); return newCarver; }
void* _malloc (size_t size, const char* file, int line) { if(debugMallocFunc) return debugMallocFunc(size, file, line); return mallocFunc(size); }
void* _calloc (size_t num, size_t size) { void* ptr = mallocFunc(num * size); if (ptr) memset(ptr, 0, num * size); return ptr; }
void* _malloc (size_t size) { return mallocFunc(size); }