mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
Merge branch 'dev' into dev-slice
This commit is contained in:
commit
cacb387a61
2 changed files with 9 additions and 1 deletions
|
@ -639,7 +639,9 @@ void* _mi_heap_realloc_zero(mi_heap_t* heap, void* p, size_t newsize, bool zero)
|
|||
memset((uint8_t*)newp + start, 0, newsize - start);
|
||||
}
|
||||
if mi_likely(p != NULL) {
|
||||
_mi_memcpy_aligned(newp, p, (newsize > size ? size : newsize));
|
||||
if mi_likely(_mi_is_aligned(p, sizeof(uintptr_t))) { // a client may pass in an arbitrary pointer `p`..
|
||||
_mi_memcpy_aligned(newp, p, (newsize > size ? size : newsize));
|
||||
}
|
||||
mi_free(p); // only free the original pointer if successful
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue