mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-25 06:13:13 +00:00
Internalize malloc_conf_2_conf_harder ctl
This commit is contained in:
@@ -46,6 +46,7 @@ extern bool opt_disable_large_size_classes;
|
|||||||
|
|
||||||
extern const char *opt_malloc_conf_symlink;
|
extern const char *opt_malloc_conf_symlink;
|
||||||
extern const char *opt_malloc_conf_env_var;
|
extern const char *opt_malloc_conf_env_var;
|
||||||
|
extern const char *je_malloc_conf_2_conf_harder;
|
||||||
|
|
||||||
/* Escape free-fastpath when ptr & mask == 0 (for sanitization purpose). */
|
/* Escape free-fastpath when ptr & mask == 0 (for sanitization purpose). */
|
||||||
extern uintptr_t san_cache_bin_nonfast_mask;
|
extern uintptr_t san_cache_bin_nonfast_mask;
|
||||||
|
|||||||
@@ -173,7 +173,6 @@ CTL_PROTO(opt_process_madvise_max_batch)
|
|||||||
CTL_PROTO(opt_malloc_conf_symlink)
|
CTL_PROTO(opt_malloc_conf_symlink)
|
||||||
CTL_PROTO(opt_malloc_conf_env_var)
|
CTL_PROTO(opt_malloc_conf_env_var)
|
||||||
CTL_PROTO(opt_malloc_conf_global_var)
|
CTL_PROTO(opt_malloc_conf_global_var)
|
||||||
CTL_PROTO(opt_malloc_conf_global_var_2_conf_harder)
|
|
||||||
CTL_PROTO(tcache_create)
|
CTL_PROTO(tcache_create)
|
||||||
CTL_PROTO(tcache_flush)
|
CTL_PROTO(tcache_flush)
|
||||||
CTL_PROTO(tcache_destroy)
|
CTL_PROTO(tcache_destroy)
|
||||||
@@ -468,9 +467,7 @@ static const ctl_named_node_t config_node[] = {
|
|||||||
static const ctl_named_node_t opt_malloc_conf_node[] = {
|
static const ctl_named_node_t opt_malloc_conf_node[] = {
|
||||||
{NAME("symlink"), CTL(opt_malloc_conf_symlink)},
|
{NAME("symlink"), CTL(opt_malloc_conf_symlink)},
|
||||||
{NAME("env_var"), CTL(opt_malloc_conf_env_var)},
|
{NAME("env_var"), CTL(opt_malloc_conf_env_var)},
|
||||||
{NAME("global_var"), CTL(opt_malloc_conf_global_var)},
|
{NAME("global_var"), CTL(opt_malloc_conf_global_var)}};
|
||||||
{NAME("global_var_2_conf_harder"),
|
|
||||||
CTL(opt_malloc_conf_global_var_2_conf_harder)}};
|
|
||||||
|
|
||||||
static const ctl_named_node_t opt_node[] = {{NAME("abort"), CTL(opt_abort)},
|
static const ctl_named_node_t opt_node[] = {{NAME("abort"), CTL(opt_abort)},
|
||||||
{NAME("abort_conf"), CTL(opt_abort_conf)},
|
{NAME("abort_conf"), CTL(opt_abort_conf)},
|
||||||
@@ -2325,9 +2322,6 @@ CTL_RO_NL_CGEN(opt_malloc_conf_env_var, opt_malloc_conf_env_var,
|
|||||||
opt_malloc_conf_env_var, const char *)
|
opt_malloc_conf_env_var, const char *)
|
||||||
CTL_RO_NL_CGEN(
|
CTL_RO_NL_CGEN(
|
||||||
je_malloc_conf, opt_malloc_conf_global_var, je_malloc_conf, const char *)
|
je_malloc_conf, opt_malloc_conf_global_var, je_malloc_conf, const char *)
|
||||||
CTL_RO_NL_CGEN(je_malloc_conf_2_conf_harder,
|
|
||||||
opt_malloc_conf_global_var_2_conf_harder, je_malloc_conf_2_conf_harder,
|
|
||||||
const char *)
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -1708,10 +1708,9 @@ stats_general_print(emitter_t *emitter) {
|
|||||||
MALLOC_CONF_WRITE("global_var", "Global variable malloc_conf");
|
MALLOC_CONF_WRITE("global_var", "Global variable malloc_conf");
|
||||||
MALLOC_CONF_WRITE("symlink", "Symbolic link malloc.conf");
|
MALLOC_CONF_WRITE("symlink", "Symbolic link malloc.conf");
|
||||||
MALLOC_CONF_WRITE("env_var", "Environment variable MALLOC_CONF");
|
MALLOC_CONF_WRITE("env_var", "Environment variable MALLOC_CONF");
|
||||||
/* As this config is unofficial, skip the output if it's NULL */
|
/* As this config is unofficial, skip the output if it's NULL. */
|
||||||
if (je_mallctl("opt.malloc_conf.global_var_2_conf_harder", (void *)&cpv,
|
if (je_malloc_conf_2_conf_harder != NULL) {
|
||||||
&cpsz, NULL, 0)
|
cpv = je_malloc_conf_2_conf_harder;
|
||||||
== 0) {
|
|
||||||
emitter_kv(emitter, "global_var_2_conf_harder",
|
emitter_kv(emitter, "global_var_2_conf_harder",
|
||||||
"Global "
|
"Global "
|
||||||
"variable malloc_conf_2_conf_harder",
|
"variable malloc_conf_2_conf_harder",
|
||||||
|
|||||||
@@ -39,13 +39,6 @@ TEST_BEGIN(test_mallctl_global_var) {
|
|||||||
expect_str_eq(mc, malloc_conf,
|
expect_str_eq(mc, malloc_conf,
|
||||||
"Unexpected value for the global variable "
|
"Unexpected value for the global variable "
|
||||||
"malloc_conf");
|
"malloc_conf");
|
||||||
|
|
||||||
expect_d_eq(mallctl("opt.malloc_conf.global_var_2_conf_harder",
|
|
||||||
(void *)&mc, &sz, NULL, 0),
|
|
||||||
0, "Unexpected mallctl() failure");
|
|
||||||
expect_str_eq(mc, malloc_conf_2_conf_harder,
|
|
||||||
"Unexpected value for the "
|
|
||||||
"global variable malloc_conf_2_conf_harder");
|
|
||||||
}
|
}
|
||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user