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:
Jason Evans 2010-12-29 12:21:05 -08:00
parent 8ad0eacfb3
commit 624f2f3cc9

View File

@ -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;