Add "default" option to slab sizes.

This comes in handy when overriding earlier settings to test alternate ones.  We
don't really include tests for this, but I claim that's OK here:
- It's fairly straightforward
- It's fairly hard to test well
- This entire code path is undocumented and mostly for our internal
  experimentation in the first place.
- I tested manually.
This commit is contained in:
David Goldblatt
2020-10-05 17:39:01 -07:00
committed by David Goldblatt
parent 21b70cb540
commit b971f7c4dd
2 changed files with 4 additions and 2 deletions

View File

@@ -1458,6 +1458,10 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
CONF_CHECK_MIN, CONF_CHECK_MAX,
true);
if (CONF_MATCH("slab_sizes")) {
if (CONF_MATCH_VALUE("default")) {
sc_data_init(sc_data);
CONF_CONTINUE;
}
bool err;
const char *slab_size_segment_cur = v;
size_t vlen_left = vlen;