X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/b435f64510a032528c42fc1cfc4eca15a4474a1b..10c12171cc2f94087c85651b14831c1e52daa087:/src/vm.c diff --git a/src/vm.c b/src/vm.c index 635016b8..1aad95d7 100644 --- a/src/vm.c +++ b/src/vm.c @@ -110,9 +110,11 @@ void vmInit(void) { /* LZF requires a lot of stack */ pthread_attr_init(&server.io_threads_attr); pthread_attr_getstacksize(&server.io_threads_attr, &stacksize); - if(!stacksize) { - stacksize = 1; - } + + /* Solaris may report a stacksize of 0, let's set it to 1 otherwise + * multiplying it by 2 in the while loop later will not really help ;) */ + if (!stacksize) stacksize = 1; + while (stacksize < REDIS_THREAD_STACK_SIZE) stacksize *= 2; pthread_attr_setstacksize(&server.io_threads_attr, stacksize); /* Listen for events in the threaded I/O pipe */ @@ -360,7 +362,7 @@ robj *vmPreviewObject(robj *o) { double computeObjectSwappability(robj *o) { /* actual age can be >= minage, but not < minage. As we use wrapping * 21 bit clocks with minutes resolution for the LRU. */ - time_t minage = abs(server.lruclock - o->lru); + time_t minage = estimateObjectIdleTime(o); long asize = 0, elesize; robj *ele; list *l;