summaryrefslogtreecommitdiff
path: root/zmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'zmalloc.c')
-rw-r--r--zmalloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zmalloc.c b/zmalloc.c
index eb06da3b8..64263756e 100644
--- a/zmalloc.c
+++ b/zmalloc.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <pthread.h>
#include "config.h"
#if defined(__sun)
@@ -40,6 +41,7 @@
#endif
static size_t used_memory = 0;
+pthread_mutex_t used_memory_mutex = PTHREAD_MUTEX_INITIALIZER;
static void zmalloc_oom(size_t size) {
fprintf(stderr, "zmalloc: Out of memory trying to allocate %zu bytes\n",