mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-27 13:33:18 +08:00
Merge branch 'dev' into dev-slice
This commit is contained in:
commit
3d6017de7c
2
src/os.c
2
src/os.c
@ -364,7 +364,7 @@ static bool mi_os_mem_free(void* addr, size_t size, bool was_committed, mi_stats
|
|||||||
// the start of the region.
|
// the start of the region.
|
||||||
MEMORY_BASIC_INFORMATION info = { 0, 0 };
|
MEMORY_BASIC_INFORMATION info = { 0, 0 };
|
||||||
VirtualQuery(addr, &info, sizeof(info));
|
VirtualQuery(addr, &info, sizeof(info));
|
||||||
if (info.AllocationBase < addr && ((uint8_t*)addr - (uint8_t*)info.AllocationBase) < MI_SEGMENT_SIZE) {
|
if (info.AllocationBase < addr && ((uint8_t*)addr - (uint8_t*)info.AllocationBase) < (ptrdiff_t)MI_SEGMENT_SIZE) {
|
||||||
errcode = 0;
|
errcode = 0;
|
||||||
err = (VirtualFree(info.AllocationBase, 0, MEM_RELEASE) == 0);
|
err = (VirtualFree(info.AllocationBase, 0, MEM_RELEASE) == 0);
|
||||||
if (err) { errcode = GetLastError(); }
|
if (err) { errcode = GetLastError(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user