X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=hashtable.h;h=4eae7571d24af74369b0f5ba55ebce40cd297a48;hb=e3da449eadbf2c92bb80b8fff073c0fa7aea5ede;hp=c877d9f1753d9dc0bd3e0a7d2dc4181f7ac636c4;hpb=5e3720f6a6dccf2af670e4ab30660130f2a57c8f;p=model-checker.git diff --git a/hashtable.h b/hashtable.h index c877d9f..4eae757 100644 --- a/hashtable.h +++ b/hashtable.h @@ -36,7 +36,7 @@ template * bin = table[i]; while(bin!=NULL) { struct hashlistnode<_Key,_Val> * next=bin->next; - _free(bin); + delete bin; bin=next; } } @@ -65,7 +65,7 @@ template * bin = table[i]; while(bin!=NULL) { struct hashlistnode<_Key,_Val> * next=bin->next; - _free(bin); + delete bin; bin=next; } } @@ -93,7 +93,7 @@ templatenext; } - struct hashlistnode<_Key,_Val> *newptr=(struct hashlistnode<_Key,_Val> *)_malloc(sizeof(struct hashlistnode<_Key,_Val>)); + struct hashlistnode<_Key,_Val> *newptr=(struct hashlistnode<_Key,_Val> *)new struct hashlistnode<_Key,_Val>; newptr->key=key; newptr->val=val; newptr->next=ptr;