// for vardata indexes void createGenInd(indexList *varList,varData *vdat,int *vals,int size){ indexList *indList = varList; int *var = Malloc(sizeof(int)*size); int n; for(n=0;n<size;n++) var[n] = vals[n]; varInd *vind = Malloc(sizeof(varInd)); vind->size = size; vind->key = var; vind->vdat = vdat; skipList sList = indList->keyList; insertSkip(sList,vind); }
// this is used for debugging, can be more fine grained than valgrind void *MallocInfoL(size_t len,char *info){ if(!globalInitDebug) InitDebug(); char *mal = Malloc(len); memInfo *mem = Malloc(sizeof(memInfo)); mem->loc = mal; mem->size = len; strncpy(mem->info,info,9); // fill with nonsense int i; for(i=0;i<len;i++) mal[i] = 0x4D; insertSkip(globalMemHolder,mem); return mal; }