Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7c6ddbc3
Commit
7c6ddbc3
authored
Nov 30, 2017
by
zhaozhao.zz
Committed by
antirez
Dec 05, 2017
Browse files
dict: fix the int problem for defrag
parent
d1176b58
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/defrag.c
View file @
7c6ddbc3
...
...
@@ -289,7 +289,7 @@ int defragKey(redisDb *db, dictEntry *de) {
/* Dirty code:
* 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 */
u
nsigned
in
t
hash
=
dictGetHash
(
db
->
dict
,
de
->
key
);
u
int64_
t
hash
=
dictGetHash
(
db
->
dict
,
de
->
key
);
replaceSateliteDictKeyPtrAndOrDefragDictEntry
(
db
->
expires
,
keysds
,
newsds
,
hash
,
&
defragged
);
}
...
...
src/dict.c
View file @
7c6ddbc3
...
...
@@ -995,7 +995,7 @@ void dictDisableResize(void) {
dict_can_resize
=
0
;
}
u
nsigned
in
t
dictGetHash
(
dict
*
d
,
const
void
*
key
)
{
u
int64_
t
dictGetHash
(
dict
*
d
,
const
void
*
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.
* no string / key comparison is performed.
* return value is the reference to the dictEntry if found, or NULL if not found. */
dictEntry
**
dictFindEntryRefByPtrAndHash
(
dict
*
d
,
const
void
*
oldptr
,
u
nsigned
in
t
hash
)
{
dictEntry
**
dictFindEntryRefByPtrAndHash
(
dict
*
d
,
const
void
*
oldptr
,
u
int64_
t
hash
)
{
dictEntry
*
he
,
**
heref
;
unsigned
long
idx
,
table
;
...
...
src/dict.h
View file @
7c6ddbc3
...
...
@@ -178,8 +178,8 @@ int dictRehashMilliseconds(dict *d, int ms);
void
dictSetHashFunctionSeed
(
uint8_t
*
seed
);
uint8_t
*
dictGetHashFunctionSeed
(
void
);
unsigned
long
dictScan
(
dict
*
d
,
unsigned
long
v
,
dictScanFunction
*
fn
,
dictScanBucketFunction
*
bucketfn
,
void
*
privdata
);
u
nsigned
in
t
dictGetHash
(
dict
*
d
,
const
void
*
key
);
dictEntry
**
dictFindEntryRefByPtrAndHash
(
dict
*
d
,
const
void
*
oldptr
,
u
nsigned
in
t
hash
);
u
int64_
t
dictGetHash
(
dict
*
d
,
const
void
*
key
);
dictEntry
**
dictFindEntryRefByPtrAndHash
(
dict
*
d
,
const
void
*
oldptr
,
u
int64_
t
hash
);
/* Hash table types */
extern
dictType
dictTypeHeapStringCopyKey
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment