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
1f84b064
Commit
1f84b064
authored
Apr 20, 2011
by
antirez
Browse files
yet more manual backporting from unstable
parent
73f01b06
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Makefile
View file @
1f84b064
...
@@ -51,7 +51,6 @@ ae_select.o: ae_select.c
...
@@ -51,7 +51,6 @@ ae_select.o: ae_select.c
anet.o
:
anet.c fmacros.h anet.h
anet.o
:
anet.c fmacros.h anet.h
aof.o
:
aof.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
aof.o
:
aof.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
chprgname.o
:
chprgname.c
config.o
:
config.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
config.o
:
config.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
db.o
:
db.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
db.o
:
db.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
...
@@ -59,6 +58,7 @@ db.o: db.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h \
...
@@ -59,6 +58,7 @@ db.o: db.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h \
debug.o
:
debug.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
debug.o
:
debug.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h sha1.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h sha1.h
dict.o
:
dict.c fmacros.h dict.h zmalloc.h
dict.o
:
dict.c fmacros.h dict.h zmalloc.h
endian.o
:
endian.c
intset.o
:
intset.c intset.h zmalloc.h
intset.o
:
intset.c intset.h zmalloc.h
lzf_c.o
:
lzf_c.c lzfP.h
lzf_c.o
:
lzf_c.c lzfP.h
lzf_d.o
:
lzf_d.c lzfP.h
lzf_d.o
:
lzf_d.c lzfP.h
...
@@ -73,11 +73,12 @@ pubsub.o: pubsub.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h \
...
@@ -73,11 +73,12 @@ pubsub.o: pubsub.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h \
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
rdb.o
:
rdb.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
rdb.o
:
rdb.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h lzf.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h lzf.h
redis-benchmark.o
:
redis-benchmark.c fmacros.h ae.h
anet.h sds.h adlist.h
\
redis-benchmark.o
:
redis-benchmark.c fmacros.h ae.h
\
zmalloc.h
../deps/hiredis/hiredis.h sds.h adlist.h
zmalloc.h
redis-check-aof.o
:
redis-check-aof.c fmacros.h config.h
redis-check-aof.o
:
redis-check-aof.c fmacros.h config.h
redis-check-dump.o
:
redis-check-dump.c lzf.h
redis-check-dump.o
:
redis-check-dump.c lzf.h
redis-cli.o
:
redis-cli.c fmacros.h version.h sds.h adlist.h zmalloc.h
redis-cli.o
:
redis-cli.c fmacros.h version.h ../deps/hiredis/hiredis.h
\
sds.h zmalloc.h ../deps/linenoise/linenoise.h help.h
redis.o
:
redis.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
redis.o
:
redis.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
release.o
:
release.c release.h
release.o
:
release.c release.h
...
@@ -87,7 +88,8 @@ sds.o: sds.c sds.h zmalloc.h
...
@@ -87,7 +88,8 @@ sds.o: sds.c sds.h zmalloc.h
sha1.o
:
sha1.c sha1.h
sha1.o
:
sha1.c sha1.h
sort.o
:
sort.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
sort.o
:
sort.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h pqsort.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h pqsort.h
syncio.o
:
syncio.c
syncio.o
:
syncio.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
t_hash.o
:
t_hash.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
t_hash.o
:
t_hash.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
t_list.o
:
t_list.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
t_list.o
:
t_list.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
...
@@ -103,8 +105,8 @@ util.o: util.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h \
...
@@ -103,8 +105,8 @@ util.o: util.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h \
vm.o
:
vm.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
vm.o
:
vm.c redis.h fmacros.h config.h ae.h sds.h dict.h adlist.h
\
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h
ziplist.o
:
ziplist.c zmalloc.h ziplist.h
ziplist.o
:
ziplist.c zmalloc.h ziplist.h
zipmap.o
:
zipmap.c zmalloc.h
zipmap.o
:
zipmap.c zmalloc.h
endian.h
zmalloc.o
:
zmalloc.c config.h
zmalloc.o
:
zmalloc.c config.h
zmalloc.h
dependencies
:
dependencies
:
cd
../deps/hiredis
&&
$(MAKE)
static
ARCH
=
"
$(ARCH)
"
cd
../deps/hiredis
&&
$(MAKE)
static
ARCH
=
"
$(ARCH)
"
...
@@ -139,7 +141,7 @@ clean:
...
@@ -139,7 +141,7 @@ clean:
rm
-rf
$(PRGNAME)
$(BENCHPRGNAME)
$(CLIPRGNAME)
$(CHECKDUMPPRGNAME)
$(CHECKAOFPRGNAME)
*
.o
*
.gcda
*
.gcno
*
.gcov
rm
-rf
$(PRGNAME)
$(BENCHPRGNAME)
$(CLIPRGNAME)
$(CHECKDUMPPRGNAME)
$(CHECKAOFPRGNAME)
*
.o
*
.gcda
*
.gcno
*
.gcov
dep
:
dep
:
$(CC)
-MM
*
.c
$(CC)
-I
../deps/hiredis
-I
../deps/linenoise
-MM
*
.c
test
:
redis-server
test
:
redis-server
(
cd
..
;
tclsh8.5 tests/test_helper.tcl
--tags
"
${TAGS}
"
--file
"
${FILE}
"
)
(
cd
..
;
tclsh8.5 tests/test_helper.tcl
--tags
"
${TAGS}
"
--file
"
${FILE}
"
)
...
...
src/redis.h
View file @
1f84b064
...
@@ -70,10 +70,12 @@
...
@@ -70,10 +70,12 @@
#define REDIS_ZSET 3
#define REDIS_ZSET 3
#define REDIS_HASH 4
#define REDIS_HASH 4
#define REDIS_VMPOINTER 8
#define REDIS_VMPOINTER 8
/* Object types only used for persistence in .rdb files */
/* Object types only used for persistence in .rdb files */
#define REDIS_HASH_ZIPMAP 9
#define REDIS_HASH_ZIPMAP 9
#define REDIS_LIST_ZIPLIST 10
#define REDIS_LIST_ZIPLIST 10
#define REDIS_SET_INTSET 11
#define REDIS_SET_INTSET 11
#define REDIS_ZSET_ZIPLIST 12
/* Objects encoding. Some kind of objects like Strings and Hashes can be
/* Objects encoding. Some kind of objects like Strings and Hashes can be
* internally represented in multiple ways. The 'encoding' field of the object
* internally represented in multiple ways. The 'encoding' field of the object
...
...
src/vm.c
View file @
1f84b064
...
@@ -411,7 +411,7 @@ double computeObjectSwappability(robj *o) {
...
@@ -411,7 +411,7 @@ double computeObjectSwappability(robj *o) {
break
;
break
;
case
REDIS_ZSET
:
case
REDIS_ZSET
:
if
(
o
->
encoding
==
REDIS_ENCODING_ZIPLIST
)
{
if
(
o
->
encoding
==
REDIS_ENCODING_ZIPLIST
)
{
asize
=
sizeof
(
*
o
)
+
(
ziplist
Size
(
o
->
ptr
)
/
2
);
asize
=
sizeof
(
*
o
)
+
(
ziplist
BlobLen
(
o
->
ptr
)
/
2
);
}
else
{
}
else
{
d
=
((
zset
*
)
o
->
ptr
)
->
dict
;
d
=
((
zset
*
)
o
->
ptr
)
->
dict
;
asize
=
sizeof
(
zset
)
+
(
sizeof
(
struct
dictEntry
*
)
*
dictSlots
(
d
));
asize
=
sizeof
(
zset
)
+
(
sizeof
(
struct
dictEntry
*
)
*
dictSlots
(
d
));
...
...
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