summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-04-26 23:26:12 (GMT)
committerJason Evans <jasone@canonware.com>2017-04-29 16:24:12 (GMT)
commitb9ab04a191dbcb9246d5180fc7ae822a85861939 (patch)
treeea4a2c8b8fd64b79499ad4680a2989e99e030464 /src
parentd901a377753cf4c75d2f72f7a692c44f61eac4a4 (diff)
downloadjemalloc-b9ab04a191dbcb9246d5180fc7ae822a85861939.zip
jemalloc-b9ab04a191dbcb9246d5180fc7ae822a85861939.tar.gz
jemalloc-b9ab04a191dbcb9246d5180fc7ae822a85861939.tar.bz2
Refactor !opt.munmap to opt.retain.
Diffstat (limited to 'src')
-rw-r--r--src/arena.c6
-rw-r--r--src/ctl.c6
-rw-r--r--src/extent.c2
-rw-r--r--src/extent_mmap.c8
-rw-r--r--src/jemalloc.c2
-rw-r--r--src/large.c2
-rw-r--r--src/stats.c2
7 files changed, 14 insertions, 14 deletions
diff --git a/src/arena.c b/src/arena.c
index 3b94a20..2c7cea0 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -1143,8 +1143,8 @@ arena_destroy_retained(tsdn_t *tsdn, arena_t *arena) {
* opportunity to unmap all retained memory without having to keep its
* own metadata structures, but if deallocation fails, that is the
* application's decision/problem. In practice, retained extents are
- * leaked here if !opt_munmap unless the application provided custom
- * extent hooks, so best practice is to either enable munmap (and avoid
+ * leaked here if opt_retain unless the application provided custom
+ * extent hooks, so best practice is to either disable retain (and avoid
* dss for arenas to be destroyed), or provide custom extent hooks that
* either unmap retained extents or track them for later use.
*/
@@ -1947,7 +1947,7 @@ arena_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
goto label_error;
}
- if (!opt_munmap) {
+ if (opt_retain) {
atomic_store_u(&arena->extent_grow_next, psz2ind(HUGEPAGE),
ATOMIC_RELAXED);
}
diff --git a/src/ctl.c b/src/ctl.c
index 3591f89..7d53a33 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -74,7 +74,7 @@ CTL_PROTO(config_stats)
CTL_PROTO(config_utrace)
CTL_PROTO(config_xmalloc)
CTL_PROTO(opt_abort)
-CTL_PROTO(opt_munmap)
+CTL_PROTO(opt_retain)
CTL_PROTO(opt_dss)
CTL_PROTO(opt_narenas)
CTL_PROTO(opt_percpu_arena)
@@ -260,7 +260,7 @@ static const ctl_named_node_t config_node[] = {
static const ctl_named_node_t opt_node[] = {
{NAME("abort"), CTL(opt_abort)},
- {NAME("munmap"), CTL(opt_munmap)},
+ {NAME("retain"), CTL(opt_retain)},
{NAME("dss"), CTL(opt_dss)},
{NAME("narenas"), CTL(opt_narenas)},
{NAME("percpu_arena"), CTL(opt_percpu_arena)},
@@ -1455,7 +1455,7 @@ CTL_RO_CONFIG_GEN(config_xmalloc, bool)
/******************************************************************************/
CTL_RO_NL_GEN(opt_abort, opt_abort, bool)
-CTL_RO_NL_GEN(opt_munmap, opt_munmap, bool)
+CTL_RO_NL_GEN(opt_retain, opt_retain, bool)
CTL_RO_NL_GEN(opt_dss, opt_dss, const char *)
CTL_RO_NL_GEN(opt_narenas, opt_narenas, unsigned)
CTL_RO_NL_GEN(opt_percpu_arena, opt_percpu_arena, const char *)
diff --git a/src/extent.c b/src/extent.c
index 1ddaf24..bc17711 100644
--- a/src/extent.c
+++ b/src/extent.c
@@ -1123,7 +1123,7 @@ extent_alloc_retained(tsdn_t *tsdn, arena_t *arena,
extent_gdump_add(tsdn, extent);
}
}
- if (!opt_munmap && extent == NULL) {
+ if (opt_retain && extent == NULL) {
extent = extent_grow_retained(tsdn, arena, r_extent_hooks,
new_addr, size, pad, alignment, slab, szind, zero, commit);
}
diff --git a/src/extent_mmap.c b/src/extent_mmap.c
index 5fe82ee..3e4e1ef 100644
--- a/src/extent_mmap.c
+++ b/src/extent_mmap.c
@@ -7,8 +7,8 @@
/******************************************************************************/
/* Data. */
-bool opt_munmap =
-#ifdef JEMALLOC_MUNMAP
+bool opt_retain =
+#ifdef JEMALLOC_RETAIN
true
#else
false
@@ -34,8 +34,8 @@ extent_alloc_mmap(void *new_addr, size_t size, size_t alignment, bool *zero,
bool
extent_dalloc_mmap(void *addr, size_t size) {
- if (opt_munmap) {
+ if (!opt_retain) {
pages_unmap(addr, size);
}
- return !opt_munmap;
+ return opt_retain;
}
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 4214600..97a6443 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -1043,7 +1043,7 @@ malloc_conf_init(void) {
}
CONF_HANDLE_BOOL(opt_abort, "abort")
- CONF_HANDLE_BOOL(opt_munmap, "munmap")
+ CONF_HANDLE_BOOL(opt_retain, "retain")
if (strncmp("dss", k, klen) == 0) {
int i;
bool match = false;
diff --git a/src/large.c b/src/large.c
index 4d515fb..f657ccb 100644
--- a/src/large.c
+++ b/src/large.c
@@ -93,7 +93,7 @@ large_dalloc_maybe_junk(void *ptr, size_t size) {
* Only bother junk filling if the extent isn't about to be
* unmapped.
*/
- if (!opt_munmap || (have_dss && extent_in_dss(ptr))) {
+ if (opt_retain || (have_dss && extent_in_dss(ptr))) {
large_dalloc_junk(ptr, size);
}
}
diff --git a/src/stats.c b/src/stats.c
index 5d51518..34fc37f 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -802,7 +802,7 @@ stats_general_print(void (*write_cb)(void *, const char *), void *cbopaque,
"Run-time option settings:\n");
}
OPT_WRITE_BOOL(abort, ",")
- OPT_WRITE_BOOL(munmap, ",")
+ OPT_WRITE_BOOL(retain, ",")
OPT_WRITE_CHAR_P(dss, ",")
OPT_WRITE_UNSIGNED(narenas, ",")
OPT_WRITE_CHAR_P(percpu_arena, ",")