aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-08-21 12:23:06 -0700
committerJason Evans <jasone@canonware.com>2015-08-21 12:33:17 -0700
commit45e9f66c280e1ba8bebf7bed387a43bc9e45536d (patch)
treed1bdea995e09f9d147fde2bce44f0bb1e3237b78 /src
parentb5c2a347d7cbf1154181ccb3adc599c8bd2094c9 (diff)
downloadjemalloc-45e9f66c280e1ba8bebf7bed387a43bc9e45536d.tar.gz
Fix arenas_cache_cleanup().
Fix arenas_cache_cleanup() to handle allocation/deallocation within the application's thread-specific data cleanup functions even after arenas_cache is torn down.
Diffstat (limited to 'src')
-rw-r--r--src/jemalloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c
index ed7863b..0361913 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -649,8 +649,12 @@ arenas_cache_cleanup(tsd_t *tsd)
arena_t **arenas_cache;
arenas_cache = tsd_arenas_cache_get(tsd);
- if (arenas_cache != NULL)
+ if (arenas_cache != NULL) {
+ bool *arenas_cache_bypassp = tsd_arenas_cache_bypassp_get(tsd);
+ *arenas_cache_bypassp = true;
+ tsd_arenas_cache_set(tsd, NULL);
a0dalloc(arenas_cache);
+ }
}
void