add guarded objects that are sampled (and fit a size range). guarded sample rate etc can be set per heap as well as defaulted with options

This commit is contained in:
daanx 2024-11-17 22:45:09 -08:00
parent 8ba1879073
commit d57cb0765d
9 changed files with 61 additions and 26 deletions

View file

@ -146,7 +146,7 @@ static mi_option_desc_t options[_mi_option_last] =
{ MI_GiB, UNINIT, MI_OPTION(guarded_max) }, // only used when building with MI_GUARDED: maximal rounded object size for guarded objects
{ 0, UNINIT, MI_OPTION(guarded_precise) }, // disregard minimal alignment requirement to always place guarded blocks exactly in front of a guard page (=0)
#if MI_GUARDED
{ 1000,UNINIT, MI_OPTION(guarded_sample_rate)}, // 1 out of N allocations in the min/max range will be guarded(= 1000)
{ 4000,UNINIT, MI_OPTION(guarded_sample_rate)}, // 1 out of N allocations in the min/max range will be guarded(= 1000)
#else
{ 0, UNINIT, MI_OPTION(guarded_sample_rate)},
#endif