mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
Fix bootstrapping order bug.
Initialize arenas_tsd earlier, so that the non-TLS case works when profiling is enabled.
This commit is contained in:
parent
47e57f9bda
commit
c957398b4f
1 changed files with 5 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue