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
@ -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…
Reference in New Issue
Block a user