Skip to content

Commit b898601

Browse files
committed
Dict Entry on Dram
1 parent 4062e26 commit b898601

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dict.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ dictEntry *dictAddRaw(dict *d, void *key, dictEntry **existing)
312312
* system it is more likely that recently added entries are accessed
313313
* more frequently. */
314314
ht = dictIsRehashing(d) ? &d->ht[1] : &d->ht[0];
315-
entry = zmalloc(sizeof(*entry));
315+
entry = zmalloc_dram(sizeof(*entry));
316316
entry->next = ht->table[index];
317317
ht->table[index] = entry;
318318
ht->used++;
@@ -390,7 +390,7 @@ static dictEntry *dictGenericDelete(dict *d, const void *key, int nofree) {
390390
if (!nofree) {
391391
dictFreeKey(d, he);
392392
dictFreeVal(d, he);
393-
zfree(he);
393+
zfree_dram(he);
394394
}
395395
d->ht[table].used--;
396396
return he;
@@ -440,7 +440,7 @@ void dictFreeUnlinkedEntry(dict *d, dictEntry *he) {
440440
if (he == NULL) return;
441441
dictFreeKey(d, he);
442442
dictFreeVal(d, he);
443-
zfree(he);
443+
zfree_dram(he);
444444
}
445445

446446
/* Destroy an entire dictionary */
@@ -458,7 +458,7 @@ int _dictClear(dict *d, dictht *ht, void(callback)(void *)) {
458458
nextHe = he->next;
459459
dictFreeKey(d, he);
460460
dictFreeVal(d, he);
461-
zfree(he);
461+
zfree_dram(he);
462462
ht->used--;
463463
he = nextHe;
464464
}

0 commit comments

Comments
 (0)