Commit 021490b1 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Get rid of more mallocs

git-svn-id: file:///svn/tokudb@96 c7de825b-a66e-492c-adef-691d508d4ae1
parent 37b9ab72
...@@ -122,9 +122,9 @@ int toku_hash_delete (HASHTABLE tab, const char *key, ITEMLEN keylen) { ...@@ -122,9 +122,9 @@ int toku_hash_delete (HASHTABLE tab, const char *key, ITEMLEN keylen) {
assert(*prev_ptr==he); assert(*prev_ptr==he);
*prev_ptr = he->next; *prev_ptr = he->next;
//printf("Freeing %s %s\n", he->key, he->val); //printf("Freeing %s %s\n", he->key, he->val);
toku_free(he->key); toku_free_n(he->key, he->keylen);
toku_free(he->val); toku_free_n(he->val, he->vallen);
toku_free(he); toku_free_n(he, sizeof(*he));
tab->n_keys--; tab->n_keys--;
if ((tab->n_keys * 4 < tab->arraysize) && tab->arraysize>4) { if ((tab->n_keys * 4 < tab->arraysize) && tab->arraysize>4) {
...@@ -199,9 +199,9 @@ static void hasheltlist_free (HASHELT elt) { ...@@ -199,9 +199,9 @@ static void hasheltlist_free (HASHELT elt) {
if (elt==0) return; if (elt==0) return;
else { else {
hasheltlist_free(elt->next); hasheltlist_free(elt->next);
toku_free(elt->key); toku_free_n(elt->key, elt->keylen);
toku_free(elt->val); toku_free_n(elt->val, elt->vallen);
toku_free(elt); toku_free_n(elt, sizeof(*elt));
} }
} }
...@@ -211,7 +211,7 @@ void toku_hashtable_free(HASHTABLE *tab) { ...@@ -211,7 +211,7 @@ void toku_hashtable_free(HASHTABLE *tab) {
toku_hashtable_clear(*tab); toku_hashtable_clear(*tab);
//printf("%s:%d free %p\n", __FILE__, __LINE__, tab);n //printf("%s:%d free %p\n", __FILE__, __LINE__, tab);n
toku_free((*tab)->array); toku_free((*tab)->array);
toku_free(*tab); toku_free_n(*tab, sizeof(**tab));
*tab=0; *tab=0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment