aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/w32heap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/w32heap.c b/src/w32heap.c
index df2fe0a8fa3..6643b439a26 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -714,13 +714,12 @@ mmap_realloc (void **var, size_t nbytes)
714 /* If there is enough room in the current reserved area, then 714 /* If there is enough room in the current reserved area, then
715 commit more pages as needed. */ 715 commit more pages as needed. */
716 if (m2.State == MEM_RESERVE 716 if (m2.State == MEM_RESERVE
717 && m2.AllocationBase == memInfo.AllocationBase
717 && nbytes <= memInfo.RegionSize + m2.RegionSize) 718 && nbytes <= memInfo.RegionSize + m2.RegionSize)
718 { 719 {
719 void *p; 720 void *p;
720 721
721 p = VirtualAlloc (*var + memInfo.RegionSize, 722 p = VirtualAlloc (*var, nbytes, MEM_COMMIT, PAGE_READWRITE);
722 nbytes - memInfo.RegionSize,
723 MEM_COMMIT, PAGE_READWRITE);
724 if (!p /* && GetLastError() != ERROR_NOT_ENOUGH_MEMORY */) 723 if (!p /* && GetLastError() != ERROR_NOT_ENOUGH_MEMORY */)
725 { 724 {
726 DebPrint (("realloc enlarge: VirtualAlloc (%p + %I64x, %I64x) error %ld\n", 725 DebPrint (("realloc enlarge: VirtualAlloc (%p + %I64x, %I64x) error %ld\n",
@@ -728,7 +727,8 @@ mmap_realloc (void **var, size_t nbytes)
728 (uint64_t)(nbytes - memInfo.RegionSize), 727 (uint64_t)(nbytes - memInfo.RegionSize),
729 GetLastError ())); 728 GetLastError ()));
730 DebPrint (("next region: %p %p %I64x %x\n", m2.BaseAddress, 729 DebPrint (("next region: %p %p %I64x %x\n", m2.BaseAddress,
731 m2.AllocationBase, m2.RegionSize, m2.AllocationProtect)); 730 m2.AllocationBase, (uint64_t)m2.RegionSize,
731 m2.AllocationProtect));
732 } 732 }
733 else 733 else
734 return *var; 734 return *var;