mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-26 17:13:35 +03:00
Fix a "thread.arena" mallctl bug.
When setting a new arena association for the calling thread, also update the tcache's cached arena pointer, primarily so that tcache_alloc_small_hard() uses the intended arena.
This commit is contained in:
parent
8ad0eacfb3
commit
624f2f3cc9
1 changed files with 5 additions and 0 deletions
|
|
@ -1137,6 +1137,11 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp,
|
||||||
|
|
||||||
/* Set new arena association. */
|
/* Set new arena association. */
|
||||||
ARENA_SET(arena);
|
ARENA_SET(arena);
|
||||||
|
{
|
||||||
|
tcache_t *tcache = TCACHE_GET();
|
||||||
|
if (tcache != NULL)
|
||||||
|
tcache->arena = arena;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue