projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix some allocation/free bugs when we put non objects into table...
[model-checker.git]
/
hashtable.h
diff --git
a/hashtable.h
b/hashtable.h
index c877d9f1753d9dc0bd3e0a7d2dc4181f7ac636c4..4eae7571d24af74369b0f5ba55ebce40cd297a48 100644
(file)
--- a/
hashtable.h
+++ b/
hashtable.h
@@
-36,7
+36,7
@@
template<typename _Key, typename _Val, typename _KeyInt, int _Shift=0, void * (*
struct hashlistnode<_Key,_Val> * bin = table[i];
while(bin!=NULL) {
struct hashlistnode<_Key,_Val> * next=bin->next;
struct hashlistnode<_Key,_Val> * bin = table[i];
while(bin!=NULL) {
struct hashlistnode<_Key,_Val> * next=bin->next;
-
_free(bin)
;
+
delete bin
;
bin=next;
}
}
bin=next;
}
}
@@
-65,7
+65,7
@@
template<typename _Key, typename _Val, typename _KeyInt, int _Shift=0, void * (*
struct hashlistnode<_Key,_Val> * bin = table[i];
while(bin!=NULL) {
struct hashlistnode<_Key,_Val> * next=bin->next;
struct hashlistnode<_Key,_Val> * bin = table[i];
while(bin!=NULL) {
struct hashlistnode<_Key,_Val> * next=bin->next;
-
_free(bin)
;
+
delete bin
;
bin=next;
}
}
bin=next;
}
}
@@
-93,7
+93,7
@@
template<typename _Key, typename _Val, typename _KeyInt, int _Shift=0, void * (*
search=search->next;
}
search=search->next;
}
- 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;
newptr->key=key;
newptr->val=val;
newptr->next=ptr;