X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/1b98a68b660501c44d3a142a12ee35e3c215b05a..ab849b7fac5f7a4bb301eb830fa0acc3ad18c18f:/src/w32heap.c diff --git a/src/w32heap.c b/src/w32heap.c index df2fe0a8fa..6643b439a2 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -714,13 +714,12 @@ mmap_realloc (void **var, size_t nbytes) /* If there is enough room in the current reserved area, then commit more pages as needed. */ if (m2.State == MEM_RESERVE + && m2.AllocationBase == memInfo.AllocationBase && nbytes <= memInfo.RegionSize + m2.RegionSize) { void *p; - p = VirtualAlloc (*var + memInfo.RegionSize, - nbytes - memInfo.RegionSize, - MEM_COMMIT, PAGE_READWRITE); + p = VirtualAlloc (*var, nbytes, MEM_COMMIT, PAGE_READWRITE); if (!p /* && GetLastError() != ERROR_NOT_ENOUGH_MEMORY */) { DebPrint (("realloc enlarge: VirtualAlloc (%p + %I64x, %I64x) error %ld\n", @@ -728,7 +727,8 @@ mmap_realloc (void **var, size_t nbytes) (uint64_t)(nbytes - memInfo.RegionSize), GetLastError ())); DebPrint (("next region: %p %p %I64x %x\n", m2.BaseAddress, - m2.AllocationBase, m2.RegionSize, m2.AllocationProtect)); + m2.AllocationBase, (uint64_t)m2.RegionSize, + m2.AllocationProtect)); } else return *var;