Enabled object encoding for multiple keys in MSET. Added a test for memory leaks in test-redis.tcl when running on Mac OS X

This commit is contained in:
antirez 2009-11-28 16:55:05 +01:00
parent 791445b745
commit 1751139117
3 changed files with 10 additions and 2 deletions

View File

@ -84,7 +84,6 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
eventLoop->fired[j].fd = e->ident; eventLoop->fired[j].fd = e->ident;
eventLoop->fired[j].mask = mask; eventLoop->fired[j].mask = mask;
} }
} }
return numevents; return numevents;
} }

View File

@ -3059,6 +3059,7 @@ static void msetGenericCommand(redisClient *c, int nx) {
for (j = 1; j < c->argc; j += 2) { for (j = 1; j < c->argc; j += 2) {
int retval; int retval;
tryObjectEncoding(c->argv[j+1]);
retval = dictAdd(c->db->dict,c->argv[j],c->argv[j+1]); retval = dictAdd(c->db->dict,c->argv[j],c->argv[j+1]);
if (retval == DICT_ERR) { if (retval == DICT_ERR) {
dictReplace(c->db->dict,c->argv[j],c->argv[j+1]); dictReplace(c->db->dict,c->argv[j],c->argv[j+1]);

View File

@ -1092,6 +1092,14 @@ proc main {server port} {
$r save $r save
} {OK} } {OK}
catch {
if {[string match {*Darwin*} [exec uname -a]]} {
test {Check for memory leaks} {
exec leaks redis-server
} {*0 leaks*}
}
}
puts "\n[expr $::passed+$::failed] tests, $::passed passed, $::failed failed" puts "\n[expr $::passed+$::failed] tests, $::passed passed, $::failed failed"
if {$::failed > 0} { if {$::failed > 0} {
puts "\n*** WARNING!!! $::failed FAILED TESTS ***\n" puts "\n*** WARNING!!! $::failed FAILED TESTS ***\n"