From 624f2f3cc9e6aa2a5eab18bd1eb84f89a6ac8b5c Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 29 Dec 2010 12:21:05 -0800 Subject: 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. --- jemalloc/src/ctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jemalloc/src/ctl.c b/jemalloc/src/ctl.c index 3c8adab..0b8b06f 100644 --- a/jemalloc/src/ctl.c +++ b/jemalloc/src/ctl.c @@ -1137,6 +1137,11 @@ thread_arena_ctl(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, /* Set new arena association. */ ARENA_SET(arena); + { + tcache_t *tcache = TCACHE_GET(); + if (tcache != NULL) + tcache->arena = arena; + } } ret = 0; -- cgit v0.12