mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 15:29:31 +03:00
merge from dev-guarded
This commit is contained in:
commit
9731941c7b
2 changed files with 2 additions and 1 deletions
|
@ -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)
|
// 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
|
// Padding should be disabled when using guard pages
|
||||||
// #define MI_DEBUG_GUARDED 1
|
#define MI_DEBUG_GUARDED 1
|
||||||
#if defined(MI_DEBUG_GUARDED)
|
#if defined(MI_DEBUG_GUARDED)
|
||||||
#define MI_PADDING 0
|
#define MI_PADDING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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; }
|
if (block_size <= 64) { start_offset += 3*block_size; }
|
||||||
else if (block_size <= 512) { start_offset += 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(_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));
|
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; }
|
if (page_size != NULL) { *page_size = psize - start_offset; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue