Skip to content

Commit

Permalink
converted a few calls to assert() => redisAssert() to print stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jan 6, 2010
1 parent e7546c6 commit f2b8ab3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,7 @@ static void freeHashObject(robj *o) {
}

static void incrRefCount(robj *o) {
assert(!server.vm_enabled || o->storage == REDIS_VM_MEMORY);
redisAssert(!server.vm_enabled || o->storage == REDIS_VM_MEMORY);
o->refcount++;
}

Expand All @@ -2369,8 +2369,8 @@ static void decrRefCount(void *obj) {

/* REDIS_VM_SWAPPED */
if (server.vm_enabled && o->storage == REDIS_VM_SWAPPED) {
assert(o->refcount == 1);
assert(o->type == REDIS_STRING);
redisAssert(o->refcount == 1);
redisAssert(o->type == REDIS_STRING);
freeStringObject(o);
vmMarkPagesFree(o->vm.page,o->vm.usedpages);
if (listLength(server.objfreelist) > REDIS_OBJFREELIST_MAX ||
Expand Down Expand Up @@ -2406,7 +2406,7 @@ static robj *lookupKey(redisDb *db, robj *key) {
key->vm.atime = server.unixtime;
} else {
/* Our value was swapped on disk. Bring it at home. */
assert(val == NULL);
redisAssert(val == NULL);
val = vmLoadObject(key);
dictGetEntryVal(de) = val;
}
Expand Down

0 comments on commit f2b8ab3

Please sign in to comment.