summaryrefslogtreecommitdiffstats
path: root/src/jemalloc.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-04-13 03:20:58 (GMT)
committerJason Evans <je@fb.com>2012-04-13 03:20:58 (GMT)
commit7ca0fdfb85b2a9fc7a112e158892c098e004385b (patch)
tree6c08126277a935f1cedb9108d25cb2315f2e8c97 /src/jemalloc.c
parentd6abcbb14b8d1c8beb1c61bfc5a24cb54578b85c (diff)
downloadjemalloc-7ca0fdfb85b2a9fc7a112e158892c098e004385b.zip
jemalloc-7ca0fdfb85b2a9fc7a112e158892c098e004385b.tar.gz
jemalloc-7ca0fdfb85b2a9fc7a112e158892c098e004385b.tar.bz2
Disable munmap() if it causes VM map holes.
Add a configure test to determine whether common mmap()/munmap() patterns cause VM map holes, and only use munmap() to discard unused chunks if the problem does not exist. Unify the chunk caching for mmap and dss. Fix options processing to limit lg_chunk to be large enough that redzones will always fit.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r--src/jemalloc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 9b8b52d..0decd8a 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -501,11 +501,14 @@ malloc_conf_init(void)
CONF_HANDLE_BOOL(opt_abort, abort)
/*
- * Chunks always require at least one * header page,
- * plus one data page.
+ * Chunks always require at least one header page, plus
+ * one data page in the absence of redzones, or three
+ * pages in the presence of redzones. In order to
+ * simplify options processing, fix the limit based on
+ * config_fill.
*/
- CONF_HANDLE_SIZE_T(opt_lg_chunk, lg_chunk, LG_PAGE+1,
- (sizeof(size_t) << 3) - 1)
+ CONF_HANDLE_SIZE_T(opt_lg_chunk, lg_chunk, LG_PAGE +
+ (config_fill ? 2 : 1), (sizeof(size_t) << 3) - 1)
CONF_HANDLE_SIZE_T(opt_narenas, narenas, 1, SIZE_T_MAX)
CONF_HANDLE_SSIZE_T(opt_lg_dirty_mult, lg_dirty_mult,
-1, (sizeof(size_t) << 3) - 1)