Add a runtime option opt_experimental_tcache_gc to guard the new design

This commit is contained in:
Shirui Cheng 2024-08-12 16:15:46 -07:00 committed by Qi Wang
parent 9e123a833c
commit f68effe4ac
4 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,7 @@ extern void (*JET_MUTABLE invalid_conf_abort)(void);
extern bool opt_utrace;
extern bool opt_xmalloc;
extern bool opt_experimental_infallible_new;
extern bool opt_experimental_tcache_gc;
extern bool opt_zero;
extern unsigned opt_narenas;
extern zero_realloc_action_t opt_zero_realloc_action;

View File

@ -131,6 +131,7 @@ CTL_PROTO(opt_zero)
CTL_PROTO(opt_utrace)
CTL_PROTO(opt_xmalloc)
CTL_PROTO(opt_experimental_infallible_new)
CTL_PROTO(opt_experimental_tcache_gc)
CTL_PROTO(opt_max_batched_size)
CTL_PROTO(opt_remote_free_max)
CTL_PROTO(opt_remote_free_max_batch)
@ -494,6 +495,8 @@ static const ctl_named_node_t opt_node[] = {
{NAME("xmalloc"), CTL(opt_xmalloc)},
{NAME("experimental_infallible_new"),
CTL(opt_experimental_infallible_new)},
{NAME("experimental_tcache_gc"),
CTL(opt_experimental_tcache_gc)},
{NAME("max_batched_size"), CTL(opt_max_batched_size)},
{NAME("remote_free_max"), CTL(opt_remote_free_max)},
{NAME("remote_free_max_batch"), CTL(opt_remote_free_max_batch)},
@ -2243,6 +2246,7 @@ CTL_RO_NL_CGEN(config_utrace, opt_utrace, opt_utrace, bool)
CTL_RO_NL_CGEN(config_xmalloc, opt_xmalloc, opt_xmalloc, bool)
CTL_RO_NL_CGEN(config_enable_cxx, opt_experimental_infallible_new,
opt_experimental_infallible_new, bool)
CTL_RO_NL_GEN(opt_experimental_tcache_gc, opt_experimental_tcache_gc, bool)
CTL_RO_NL_GEN(opt_max_batched_size, opt_bin_info_max_batched_size, size_t)
CTL_RO_NL_GEN(opt_remote_free_max, opt_bin_info_remote_free_max,
size_t)

View File

@ -151,6 +151,7 @@ void (*JET_MUTABLE invalid_conf_abort)(void) = &abort;
bool opt_utrace = false;
bool opt_xmalloc = false;
bool opt_experimental_infallible_new = false;
bool opt_experimental_tcache_gc = false;
bool opt_zero = false;
unsigned opt_narenas = 0;
static fxp_t opt_narenas_ratio = FXP_INIT_INT(4);
@ -1414,6 +1415,8 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
"experimental_infallible_new")
}
CONF_HANDLE_BOOL(opt_experimental_tcache_gc,
"experimental_tcache_gc")
CONF_HANDLE_BOOL(opt_tcache, "tcache")
CONF_HANDLE_SIZE_T(opt_tcache_max, "tcache_max",
0, TCACHE_MAXCLASS_LIMIT, CONF_DONT_CHECK_MIN,

View File

@ -1600,6 +1600,7 @@ stats_general_print(emitter_t *emitter) {
OPT_WRITE_BOOL("utrace")
OPT_WRITE_BOOL("xmalloc")
OPT_WRITE_BOOL("experimental_infallible_new")
OPT_WRITE_BOOL("experimental_tcache_gc")
OPT_WRITE_SIZE_T("max_batched_size")
OPT_WRITE_SIZE_T("remote_free_max")
OPT_WRITE_SIZE_T("remote_free_max_batch")