From eb29d6b06f0f0d38aa8d7edd036d1dc412395393 Mon Sep 17 00:00:00 2001 From: Daan Leijen Date: Sat, 21 May 2022 10:21:38 -0700 Subject: [PATCH] fix warning on windows --- src/os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os.c b/src/os.c index 82b38007..855cc3a7 100644 --- a/src/os.c +++ b/src/os.c @@ -375,7 +375,7 @@ static bool mi_os_mem_free(void* addr, size_t size, bool was_committed, mi_stats // the start of the region. MEMORY_BASIC_INFORMATION info = { 0, 0 }; 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; err = (VirtualFree(info.AllocationBase, 0, MEM_RELEASE) == 0); if (err) { errcode = GetLastError(); }