mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
dict: fix the int problem for defrag
This commit is contained in:
parent
d1176b582c
commit
7c6ddbc37d
@ -289,7 +289,7 @@ int defragKey(redisDb *db, dictEntry *de) {
|
|||||||
/* Dirty code:
|
/* Dirty code:
|
||||||
* I can't search in db->expires for that key after i already released
|
* I can't search in db->expires for that key after i already released
|
||||||
* the pointer it holds it won't be able to do the string compare */
|
* the pointer it holds it won't be able to do the string compare */
|
||||||
unsigned int hash = dictGetHash(db->dict, de->key);
|
uint64_t hash = dictGetHash(db->dict, de->key);
|
||||||
replaceSateliteDictKeyPtrAndOrDefragDictEntry(db->expires, keysds, newsds, hash, &defragged);
|
replaceSateliteDictKeyPtrAndOrDefragDictEntry(db->expires, keysds, newsds, hash, &defragged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -995,7 +995,7 @@ void dictDisableResize(void) {
|
|||||||
dict_can_resize = 0;
|
dict_can_resize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int dictGetHash(dict *d, const void *key) {
|
uint64_t dictGetHash(dict *d, const void *key) {
|
||||||
return dictHashKey(d, key);
|
return dictHashKey(d, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ unsigned int dictGetHash(dict *d, const void *key) {
|
|||||||
* the hash value should be provided using dictGetHash.
|
* the hash value should be provided using dictGetHash.
|
||||||
* no string / key comparison is performed.
|
* no string / key comparison is performed.
|
||||||
* return value is the reference to the dictEntry if found, or NULL if not found. */
|
* return value is the reference to the dictEntry if found, or NULL if not found. */
|
||||||
dictEntry **dictFindEntryRefByPtrAndHash(dict *d, const void *oldptr, unsigned int hash) {
|
dictEntry **dictFindEntryRefByPtrAndHash(dict *d, const void *oldptr, uint64_t hash) {
|
||||||
dictEntry *he, **heref;
|
dictEntry *he, **heref;
|
||||||
unsigned long idx, table;
|
unsigned long idx, table;
|
||||||
|
|
||||||
|
@ -178,8 +178,8 @@ int dictRehashMilliseconds(dict *d, int ms);
|
|||||||
void dictSetHashFunctionSeed(uint8_t *seed);
|
void dictSetHashFunctionSeed(uint8_t *seed);
|
||||||
uint8_t *dictGetHashFunctionSeed(void);
|
uint8_t *dictGetHashFunctionSeed(void);
|
||||||
unsigned long dictScan(dict *d, unsigned long v, dictScanFunction *fn, dictScanBucketFunction *bucketfn, void *privdata);
|
unsigned long dictScan(dict *d, unsigned long v, dictScanFunction *fn, dictScanBucketFunction *bucketfn, void *privdata);
|
||||||
unsigned int dictGetHash(dict *d, const void *key);
|
uint64_t dictGetHash(dict *d, const void *key);
|
||||||
dictEntry **dictFindEntryRefByPtrAndHash(dict *d, const void *oldptr, unsigned int hash);
|
dictEntry **dictFindEntryRefByPtrAndHash(dict *d, const void *oldptr, uint64_t hash);
|
||||||
|
|
||||||
/* Hash table types */
|
/* Hash table types */
|
||||||
extern dictType dictTypeHeapStringCopyKey;
|
extern dictType dictTypeHeapStringCopyKey;
|
||||||
|
Loading…
Reference in New Issue
Block a user