summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2015-02-10 00:19:27 (GMT)
committerJason Evans <je@fb.com>2015-02-10 01:43:10 (GMT)
commit23694b07457f3aaf9605a4ff6b386f3c897eb624 (patch)
tree46f7abf54bea893020cd28b21857cd11456a07a7
parent8d0e04d42f4750970ac3052a6c76379b60aba5dc (diff)
downloadjemalloc-23694b07457f3aaf9605a4ff6b386f3c897eb624.zip
jemalloc-23694b07457f3aaf9605a4ff6b386f3c897eb624.tar.gz
jemalloc-23694b07457f3aaf9605a4ff6b386f3c897eb624.tar.bz2
Fix arena_get() for (!init_if_missing && refresh_if_missing) case.
Fix arena_get() to refresh the cache as needed in the (!init_if_missing && refresh_if_missing) case. This flaw was introduced by the initial arena_get() implementation, which was part of 8bb3198f72fc7587dc93527f9f19fb5be52fa553 (Refactor/fix arenas manipulation.).
-rw-r--r--include/jemalloc/internal/jemalloc_internal.h.in5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in
index 280501d..2b16742 100644
--- a/include/jemalloc/internal/jemalloc_internal.h.in
+++ b/include/jemalloc/internal/jemalloc_internal.h.in
@@ -755,10 +755,7 @@ arena_get(tsd_t *tsd, unsigned ind, bool init_if_missing,
arena = arenas_cache[ind];
if (likely(arena != NULL) || !refresh_if_missing)
return (arena);
- if (init_if_missing)
- return (arena_get_hard(tsd, ind, init_if_missing));
- else
- return (NULL);
+ return (arena_get_hard(tsd, ind, init_if_missing));
}
#endif