From ed3d152ea0aa39169a9629962a40c58e67b0b532 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 11 May 2010 12:00:22 -0700 Subject: [PATCH] Fix next_arena initialization. If there is more than one arena, initialize next_arena so that the first and second threads to allocate memory use arenas 0 and 1, rather than both using arena 0. --- jemalloc/src/jemalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jemalloc/src/jemalloc.c b/jemalloc/src/jemalloc.c index aeab1408..bf2ace39 100644 --- a/jemalloc/src/jemalloc.c +++ b/jemalloc/src/jemalloc.c @@ -775,7 +775,7 @@ MALLOC_OUT: #endif #ifndef NO_TLS - next_arena = 0; + next_arena = (narenas > 0) ? 1 : 0; #endif /* Allocate and initialize arenas. */