summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Goldblatt <davidgoldblatt@fb.com>2019-03-23 00:13:45 (GMT)
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2019-04-15 23:48:12 (GMT)
commitf95a88fcd92e8ead1a6c5c8b2ca8c401c6eba162 (patch)
treead0bae26c42ba72a776dd6a540a1c9bab5c9cf07
parentf4d24f05e1f270c43bc4129c0d18d673b8ac85b8 (diff)
downloadjemalloc-f95a88fcd92e8ead1a6c5c8b2ca8c401c6eba162.zip
jemalloc-f95a88fcd92e8ead1a6c5c8b2ca8c401c6eba162.tar.gz
jemalloc-f95a88fcd92e8ead1a6c5c8b2ca8c401c6eba162.tar.bz2
Safety checks: Expose config value via mallctl and stats.
-rw-r--r--src/ctl.c3
-rw-r--r--src/stats.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 193d2b0..c113bf2 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -72,6 +72,7 @@ CTL_PROTO(config_debug)
CTL_PROTO(config_fill)
CTL_PROTO(config_lazy_lock)
CTL_PROTO(config_malloc_conf)
+CTL_PROTO(config_opt_safety_checks)
CTL_PROTO(config_prof)
CTL_PROTO(config_prof_libgcc)
CTL_PROTO(config_prof_libunwind)
@@ -286,6 +287,7 @@ static const ctl_named_node_t config_node[] = {
{NAME("fill"), CTL(config_fill)},
{NAME("lazy_lock"), CTL(config_lazy_lock)},
{NAME("malloc_conf"), CTL(config_malloc_conf)},
+ {NAME("opt_safety_checks"), CTL(config_opt_safety_checks)},
{NAME("prof"), CTL(config_prof)},
{NAME("prof_libgcc"), CTL(config_prof_libgcc)},
{NAME("prof_libunwind"), CTL(config_prof_libunwind)},
@@ -1706,6 +1708,7 @@ CTL_RO_CONFIG_GEN(config_debug, bool)
CTL_RO_CONFIG_GEN(config_fill, bool)
CTL_RO_CONFIG_GEN(config_lazy_lock, bool)
CTL_RO_CONFIG_GEN(config_malloc_conf, const char *)
+CTL_RO_CONFIG_GEN(config_opt_safety_checks, bool)
CTL_RO_CONFIG_GEN(config_prof, bool)
CTL_RO_CONFIG_GEN(config_prof_libgcc, bool)
CTL_RO_CONFIG_GEN(config_prof_libunwind, bool)
diff --git a/src/stats.c b/src/stats.c
index 4c427e0..2be9a7e 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -976,6 +976,7 @@ stats_general_print(emitter_t *emitter) {
emitter_kv(emitter, "malloc_conf", "config.malloc_conf",
emitter_type_string, &config_malloc_conf);
+ CONFIG_WRITE_BOOL(opt_safety_checks);
CONFIG_WRITE_BOOL(prof);
CONFIG_WRITE_BOOL(prof_libgcc);
CONFIG_WRITE_BOOL(prof_libunwind);