mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Fix missing dismiss hash listpack memory due to ziplist->listpack migration (#9353)
This commit is contained in:
parent
82528d2678
commit
5705cec68e
12
src/object.c
12
src/object.c
@ -422,6 +422,8 @@ void dismissListObject(robj *o, size_t size_hint) {
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
serverPanic("Unknown list encoding type");
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,6 +448,8 @@ void dismissSetObject(robj *o, size_t size_hint) {
|
||||
dismissMemory(set->ht_table[1], DICTHT_SIZE(set->ht_size_exp[1])*sizeof(dictEntry*));
|
||||
} else if (o->encoding == OBJ_ENCODING_INTSET) {
|
||||
dismissMemory(o->ptr, intsetBlobLen((intset*)o->ptr));
|
||||
} else {
|
||||
serverPanic("Unknown set encoding type");
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,6 +475,8 @@ void dismissZsetObject(robj *o, size_t size_hint) {
|
||||
dismissMemory(d->ht_table[1], DICTHT_SIZE(d->ht_size_exp[1])*sizeof(dictEntry*));
|
||||
} else if (o->encoding == OBJ_ENCODING_ZIPLIST) {
|
||||
dismissMemory(o->ptr, ziplistBlobLen((unsigned char*)o->ptr));
|
||||
} else {
|
||||
serverPanic("Unknown zset encoding type");
|
||||
}
|
||||
}
|
||||
|
||||
@ -495,8 +501,10 @@ void dismissHashObject(robj *o, size_t size_hint) {
|
||||
/* Dismiss hash table memory. */
|
||||
dismissMemory(d->ht_table[0], DICTHT_SIZE(d->ht_size_exp[0])*sizeof(dictEntry*));
|
||||
dismissMemory(d->ht_table[1], DICTHT_SIZE(d->ht_size_exp[1])*sizeof(dictEntry*));
|
||||
} else if (o->encoding == OBJ_ENCODING_ZIPLIST) {
|
||||
dismissMemory(o->ptr, ziplistBlobLen((unsigned char*)o->ptr));
|
||||
} else if (o->encoding == OBJ_ENCODING_LISTPACK) {
|
||||
dismissMemory(o->ptr, lpBytes((unsigned char*)o->ptr));
|
||||
} else {
|
||||
serverPanic("Unknown hash encoding type");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user