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

@ -675,7 +675,7 @@ void backgroundRewriteDoneHandler(int statloc);
/* Sorted sets data type */
zskiplist *zslCreate(void);
void zslFree(zskiplist *zsl);
void zslInsert(zskiplist *zsl, double score, robj *obj);
zskiplistNode *zslInsert(zskiplist *zsl, double score, robj *obj);
/* Core functions */
void freeMemoryIfNeeded(void);