diff options
author | Daan Leijen <daan@microsoft.com> | 2022-04-14 16:07:57 -0700 |
---|---|---|
committer | Daan Leijen <daan@microsoft.com> | 2022-04-14 16:07:57 -0700 |
commit | b86bbbff0055de72f840282f1f98c3bfe90dfe8f (patch) | |
tree | 4de935b71a7b7aac3838fc2ad526b5ff933810fb /src/options.c | |
parent | dd929659ab4329ed3d42c423e692ab418cff1856 (diff) | |
parent | f87cba9bd89f0a34838effa4366a73ddbe0963a6 (diff) |
merge from dev
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/options.c b/src/options.c index 7eb1eba..80feacf 100644 --- a/src/options.c +++ b/src/options.c @@ -93,7 +93,8 @@ static mi_option_desc_t options[_mi_option_last] = { 16, UNINIT, MI_OPTION(max_warnings) }, // maximum warnings that are output { 1, UNINIT, MI_OPTION(allow_decommit) }, // decommit slices when no longer used (after decommit_delay milli-seconds) { 500, UNINIT, MI_OPTION(segment_decommit_delay) }, // decommit delay in milli-seconds for freed segments - { 2, UNINIT, MI_OPTION(decommit_extend_delay) } + { 2, UNINIT, MI_OPTION(decommit_extend_delay) }, + { 8, UNINIT, MI_OPTION(max_segment_reclaim)},// max. number of segment reclaims from the abandoned segments per try. }; static void mi_option_init(mi_option_desc_t* desc); @@ -125,6 +126,11 @@ mi_decl_nodiscard long mi_option_get(mi_option_t option) { return desc->value; } +mi_decl_nodiscard long mi_option_get_clamp(mi_option_t option, long min, long max) { + long x = mi_option_get(option); + return (x < min ? min : (x > max ? max : x)); +} + void mi_option_set(mi_option_t option, long value) { mi_assert(option >= 0 && option < _mi_option_last); if (option < 0 || option >= _mi_option_last) return; |