mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 15:09:31 +03:00
comments
This commit is contained in:
parent
f76a678c04
commit
d9f6ab58c5
1 changed files with 2 additions and 2 deletions
|
@ -37,9 +37,9 @@ extern inline void* _mi_page_malloc(mi_heap_t* heap, mi_page_t* page, size_t siz
|
||||||
page->free = mi_block_next(page, block);
|
page->free = mi_block_next(page, block);
|
||||||
mi_assert_internal(page->free == NULL || _mi_ptr_page(page->free) == page);
|
mi_assert_internal(page->free == NULL || _mi_ptr_page(page->free) == page);
|
||||||
|
|
||||||
// zero the block?
|
// zero the block? note: we need to zero the full block size (issue #63)
|
||||||
if mi_unlikely(zero) {
|
if mi_unlikely(zero) {
|
||||||
mi_assert_internal(page->xblock_size != 0); // do not call with zero'ing for huge blocks
|
mi_assert_internal(page->xblock_size != 0); // do not call with zero'ing for huge blocks (see _mi_malloc_generic)
|
||||||
const size_t zsize = (page->is_zero ? sizeof(block->next) : page->xblock_size);
|
const size_t zsize = (page->is_zero ? sizeof(block->next) : page->xblock_size);
|
||||||
_mi_memzero_aligned(block, zsize);
|
_mi_memzero_aligned(block, zsize);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue