]> git.saurik.com Git - redis.git/blobdiff - redis.c
thread safe zmalloc used memory counter
[redis.git] / redis.c
diff --git a/redis.c b/redis.c
index 7c87178d69a0d466727cd95f0bddcf713ac1bd79..47c93f732474fdb74bbdae6461dc0b5a7f59a141 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -6999,6 +6999,9 @@ static void vmInit(void) {
     int pipefds[2];
     size_t stacksize;
 
+    if (server.vm_max_threads != 0)
+        zmalloc_enable_thread_safeness(); /* we need thread safe zmalloc() */
+
     server.vm_fp = fopen("/tmp/redisvm","w+b");
     if (server.vm_fp == NULL) {
         redisLog(REDIS_WARNING,"Impossible to open the swap file. Exiting.");