summaryrefslogtreecommitdiff
path: root/src/zmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zmalloc.c')
-rw-r--r--src/zmalloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/zmalloc.c b/src/zmalloc.c
index e36319241..cefa39aa8 100644
--- a/src/zmalloc.c
+++ b/src/zmalloc.c
@@ -74,8 +74,7 @@ void zlibc_free(void *ptr) {
#define update_zmalloc_stat_alloc(__n) atomicIncr(used_memory,(__n))
#define update_zmalloc_stat_free(__n) atomicDecr(used_memory,(__n))
-static size_t used_memory = 0;
-pthread_mutex_t used_memory_mutex = PTHREAD_MUTEX_INITIALIZER;
+static redisAtomic size_t used_memory = 0;
static void zmalloc_default_oom(size_t size) {
fprintf(stderr, "zmalloc: Out of memory trying to allocate %zu bytes\n",