merge from dev-guarded

This commit is contained in:
Daan Leijen 2024-08-20 13:11:54 -07:00
commit 9731941c7b
2 changed files with 2 additions and 1 deletions

View file

@ -75,7 +75,7 @@ terms of the MIT license. A copy of the license can be found in the file
// Use guard pages behind objects of a certain size (set by the MIMALLOC_DEBUG_GUARDED_MIN/MAX options)
// Padding should be disabled when using guard pages
// #define MI_DEBUG_GUARDED 1
#define MI_DEBUG_GUARDED 1
#if defined(MI_DEBUG_GUARDED)
#define MI_PADDING 0
#endif

View file

@ -332,6 +332,7 @@ static uint8_t* _mi_segment_page_start_from_slice(const mi_segment_t* segment, c
if (block_size <= 64) { start_offset += 3*block_size; }
else if (block_size <= 512) { start_offset += block_size; }
}
start_offset = _mi_align_up(start_offset, MI_MAX_ALIGN_SIZE);
mi_assert_internal(_mi_is_aligned(pstart + start_offset, MI_MAX_ALIGN_SIZE));
mi_assert_internal(block_size == 0 || block_size > MI_MAX_ALIGN_GUARANTEE || _mi_is_aligned(pstart + start_offset,block_size));
if (page_size != NULL) { *page_size = psize - start_offset; }