Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
6fbafbe9
Commit
6fbafbe9
authored
Jan 12, 2023
by
Vitaly Arbuzov
Browse files
Resolve errors after merge
parent
292df99a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
6fbafbe9
...
@@ -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); */
d
b
->
dict
->
type
->
valDestructor
(
d
,
old
);
d
->
type
->
valDestructor
(
d
,
old
);
}
}
}
}
...
...
src/dict.c
View file @
6fbafbe9
...
@@ -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
);
}
}
...
...
src/dict.h
View file @
6fbafbe9
...
@@ -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
...
...
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