From f2b8ab346abd82d76a749a582396b053928e57af Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 5 Jan 2010 19:44:22 -0500 Subject: [PATCH] converted a few calls to assert() => redisAssert() to print stack trace --- redis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redis.c b/redis.c index d8243b6b6..e427ab603 100644 --- a/redis.c +++ b/redis.c @@ -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++; } @@ -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 || @@ -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; }