diff options
author | Jason Evans <je@fb.com> | 2011-03-23 07:27:50 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2011-03-23 07:27:50 (GMT) |
commit | c957398b4f973158de323366dbd424b7bb812ddf (patch) | |
tree | 7a58ab72c1e782433da8a7a27fe4f585ea9d6c0e /jemalloc | |
parent | 47e57f9bdadfaf999c9dea5d126edf3a4f1b2995 (diff) | |
download | jemalloc-c957398b4f973158de323366dbd424b7bb812ddf.zip jemalloc-c957398b4f973158de323366dbd424b7bb812ddf.tar.gz jemalloc-c957398b4f973158de323366dbd424b7bb812ddf.tar.bz2 |
Fix bootstrapping order bug.
Initialize arenas_tsd earlier, so that the non-TLS case works when
profiling is enabled.
Diffstat (limited to 'jemalloc')
-rw-r--r-- | jemalloc/src/jemalloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/jemalloc/src/jemalloc.c b/jemalloc/src/jemalloc.c index dccce6b..4d24470 100644 --- a/jemalloc/src/jemalloc.c +++ b/jemalloc/src/jemalloc.c @@ -797,6 +797,11 @@ malloc_init_hard(void) 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); @@ -835,11 +840,6 @@ malloc_init_hard(void) malloc_write(")\n"); } - if (pthread_key_create(&arenas_tsd, arenas_cleanup) != 0) { - malloc_mutex_unlock(&init_lock); - return (true); - } - /* Allocate and initialize arenas. */ arenas = (arena_t **)base_alloc(sizeof(arena_t *) * narenas); if (arenas == NULL) { |