mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-09-17 19:54:47 +03:00
support zero-initialized memory detection
This commit is contained in:
parent
216d75a222
commit
d1bd1644d5
9 changed files with 123 additions and 48 deletions
|
@ -33,7 +33,7 @@ static void* mi_heap_malloc_zero_aligned_at(mi_heap_t* heap, size_t size, size_t
|
|||
void* p = _mi_page_malloc(heap,page,size);
|
||||
mi_assert_internal(p != NULL);
|
||||
mi_assert_internal(((uintptr_t)p + offset) % alignment == 0);
|
||||
if (zero) memset(p,0,size);
|
||||
if (zero) _mi_block_zero_init(p,size);
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue