fix padding check and set default extra padding to 0

This commit is contained in:
daan 2020-04-07 10:35:51 -07:00
parent 2e175c1221
commit 6b6a8a2315
2 changed files with 2 additions and 2 deletions

View file

@ -273,7 +273,7 @@ typedef struct mi_segment_s {
// In debug mode there is a padding stucture at the end
// of the blocks to check for buffer overflows.
// ------------------------------------------------------
#if defined(MI_PADDING)
#if (MI_PADDING)
typedef struct mi_padding_s {
uint32_t canary; // encoded block value to check validity of the padding (in case of heap block overflow)
uint32_t delta; // padding bytes before the block. (mi_usable_size(p) - delta == exact allocated bytes)

View file

@ -77,7 +77,7 @@ static mi_option_desc_t options[_mi_option_last] =
#endif
{ 100, UNINIT, MI_OPTION(reset_delay) }, // reset delay in milli-seconds
{ 0, UNINIT, MI_OPTION(use_numa_nodes) }, // 0 = use available numa nodes, otherwise use at most N nodes.
{ 160, UNINIT, MI_OPTION(debug_extra_padding) }, // extra padding in bytes
{ 0, UNINIT, MI_OPTION(debug_extra_padding) }, // extra padding in bytes
{ 100, UNINIT, MI_OPTION(os_tag) }, // only apple specific for now but might serve more or less related purpose
{ 16, UNINIT, MI_OPTION(max_errors) } // maximum errors that are output
};