Commit 6fbafbe9 authored by Vitaly Arbuzov's avatar Vitaly Arbuzov
Browse files

Resolve errors after merge

parent 292df99a
...@@ -308,7 +308,7 @@ static void dbSetValue(redisDb *db, robj *key, robj *val, int overwrite) { ...@@ -308,7 +308,7 @@ static void dbSetValue(redisDb *db, robj *key, robj *val, int overwrite) {
freeObjAsync(key,old,db->id); freeObjAsync(key,old,db->id);
} else { } else {
/* This is just decrRefCount(old); */ /* This is just decrRefCount(old); */
db->dict->type->valDestructor(d, old); d->type->valDestructor(d, old);
} }
} }
......
...@@ -185,12 +185,7 @@ static void _dictReset(dict *d, int htidx) ...@@ -185,12 +185,7 @@ static void _dictReset(dict *d, int htidx)
/* Create a new hash table */ /* Create a new hash table */
dict *dictCreate(dictType *type) dict *dictCreate(dictType *type)
{ {
size_t metasize = type->dictMetadataBytes ? type->dictMetadataBytes() : 0; dict *d = zmalloc(sizeof(*d));
dict *d = zmalloc(sizeof(*d) + metasize);
if (metasize) {
memset(dictMetadata(d), 0, metasize);
}
_dictInit(d,type); _dictInit(d,type);
return d; return d;
} }
...@@ -425,11 +420,6 @@ static void _dictRehashStep(dict *d) { ...@@ -425,11 +420,6 @@ static void _dictRehashStep(dict *d) {
if (d->pauserehash == 0) dictRehash(d,1); if (d->pauserehash == 0) dictRehash(d,1);
} }
/* Return a pointer to the metadata section within the dict. */
void *dictMetadata(dict *d) {
return &d->metadata;
}
/* Add an element to the target hash table */ /* Add an element to the target hash table */
int dictAdd(dict *d, void *key, void *val) int dictAdd(dict *d, void *key, void *val)
{ {
...@@ -793,12 +783,6 @@ double dictIncrDoubleVal(dictEntry *de, double val) { ...@@ -793,12 +783,6 @@ double dictIncrDoubleVal(dictEntry *de, double val) {
return de->v.d += val; return de->v.d += val;
} }
/* A pointer to the metadata section within the dict entry. */
void *dictEntryMetadata(dictEntry *de) {
assert(entryHasValue(de));
return &de->metadata;
}
void *dictGetKey(const dictEntry *de) { void *dictGetKey(const dictEntry *de) {
if (entryIsKey(de)) return (void*)de; if (entryIsKey(de)) return (void*)de;
if (entryIsNoValue(de)) return decodeEntryNoValue(de)->key; if (entryIsNoValue(de)) return decodeEntryNoValue(de)->key;
...@@ -1148,8 +1132,6 @@ static void dictDefragBucket(dict *d, dictEntry **bucketref, dictDefragFunctions ...@@ -1148,8 +1132,6 @@ static void dictDefragBucket(dict *d, dictEntry **bucketref, dictDefragFunctions
} }
if (newde) { if (newde) {
*bucketref = newde; *bucketref = newde;
if (d->type->afterReplaceEntry)
d->type->afterReplaceEntry(d, newde);
} }
bucketref = dictGetNextRef(*bucketref); bucketref = dictGetNextRef(*bucketref);
} }
......
...@@ -94,10 +94,6 @@ struct dict { ...@@ -94,10 +94,6 @@ struct dict {
/* Keep small vars at end for optimal (minimal) struct padding */ /* Keep small vars at end for optimal (minimal) struct padding */
int16_t pauserehash; /* If >0 rehashing is paused (<0 indicates coding error) */ int16_t pauserehash; /* If >0 rehashing is paused (<0 indicates coding error) */
signed char ht_size_exp[2]; /* exponent of size. (size = 1<<exp) */ signed char ht_size_exp[2]; /* exponent of size. (size = 1<<exp) */
void *metadata[]; /* An arbitrary number of bytes (starting at a
* pointer-aligned address) of size as defined
* by dictType's dictEntryBytes. */
}; };
/* If safe is set to 1 this is a safe iterator, that means, you can call /* If safe is set to 1 this is a safe iterator, that means, you can call
......
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