diff options
author | Jason Evans <je@fb.com> | 2011-11-06 04:50:15 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2011-11-06 04:50:15 (GMT) |
commit | d1c526d53b613474975ccd0124e3150f54a991d1 (patch) | |
tree | 218bbb5b2287b3621d50a2bb78a195dfa0a5e7eb /src | |
parent | 5bdbae57eecd92755be8e7a59d6ff8b46f50e6ad (diff) | |
parent | 45e040a82c121fb74337b61b3d8597b028b2dd32 (diff) | |
download | jemalloc-2.2.4.zip jemalloc-2.2.4.tar.gz jemalloc-2.2.4.tar.bz2 |
Merge branch '2_2_4_bp'2.2.4
Diffstat (limited to 'src')
-rw-r--r-- | src/jemalloc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c index fd8bf52..a161c2e 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -689,7 +689,7 @@ malloc_init_hard(void) result = sysconf(_SC_PAGESIZE); assert(result != -1); - pagesize = (unsigned)result; + pagesize = (size_t)result; /* * We assume that pagesize is a power of 2 when calculating @@ -769,6 +769,14 @@ malloc_init_hard(void) } #endif + if (malloc_mutex_init(&arenas_lock)) + return (true); + + if (pthread_key_create(&arenas_tsd, arenas_cleanup) != 0) { + malloc_mutex_unlock(&init_lock); + return (true); + } + /* * Create enough scaffolding to allow recursive allocation in * malloc_ncpus(). @@ -795,14 +803,6 @@ malloc_init_hard(void) ARENA_SET(arenas[0]); arenas[0]->nthreads++; - if (malloc_mutex_init(&arenas_lock)) - return (true); - - if (pthread_key_create(&arenas_tsd, arenas_cleanup) != 0) { - malloc_mutex_unlock(&init_lock); - return (true); - } - #ifdef JEMALLOC_PROF if (prof_boot2()) { malloc_mutex_unlock(&init_lock); |