mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-11 21:58:41 +03:00
Fixing bug where allocating a new arena would not zero memory correctly
This commit is contained in:
parent
4e50d6714d
commit
e26d4a4ddb
1 changed files with 5 additions and 1 deletions
|
@ -179,7 +179,11 @@ static void* mi_arena_meta_zalloc(size_t size, mi_memid_t* memid, mi_stats_t* st
|
|||
if (p != NULL) return p;
|
||||
|
||||
// or fall back to the OS
|
||||
return _mi_os_alloc(size, memid, stats);
|
||||
p = _mi_os_alloc(size,memid,stats);
|
||||
if (p != NULL && !memid->initially_zero) {
|
||||
_mi_memzero(p,size);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
static void mi_arena_meta_free(void* p, mi_memid_t memid, size_t size, mi_stats_t* stats) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue