示例#1
0
文件: Sarq.c 项目: joseph8th/unm-cs
/* 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;
}
示例#2
0
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;
}
示例#3
0
void* _malloc (size_t size, const char* file, int line) {
	if(debugMallocFunc)
		return debugMallocFunc(size, file, line);

	return mallocFunc(size);
}
示例#4
0
void* _calloc (size_t num, size_t size) {
	void* ptr = mallocFunc(num * size);
	if (ptr) memset(ptr, 0, num * size);
	return ptr;
}
示例#5
0
void* _malloc (size_t size) {
	return mallocFunc(size);
}