Reference zset score in zskiplistNode from dict entries

This avoids the extra allocation of sizeof(double) for storing the score
of a zset entry in the hash table. Saves sizeof(double) + malloc
overhead = approx. 16 bytes per zset entry.
This commit is contained in:
Pieter Noordhuis
2010-08-03 20:49:53 +02:00
parent 2159782b51
commit 69ef89f2cf
3 changed files with 60 additions and 59 deletions

View File

@ -338,7 +338,7 @@ dictType zsetDictType = {
NULL, /* val dup */
dictEncObjKeyCompare, /* key compare */
dictRedisObjectDestructor, /* key destructor */
dictVanillaFree /* val destructor of malloc(sizeof(double)) */
NULL /* val destructor */
};
/* Db->dict, keys are sds strings, vals are Redis objects. */