]> granicus.if.org Git - gc/commitdiff
Fix GC_win32_free_heap compilation error for Cygwin
authorIvan Maidanski <ivmai@mail.ru>
Sun, 23 Dec 2012 12:03:36 +0000 (16:03 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 23 Dec 2012 16:13:37 +0000 (17:13 +0100)
(fix commit 'caa5af9')

* os_dep.c (GC_win32_free_heap): Do not invoke virtual free for
Cygwin, remove "else" branch  (only if MSWIN32 but not CYGWIN32).

os_dep.c

index 2074f4658b6c892514af0f0892739afa896b85fb..0585802181fe6f62e9d7f0960f8660c7f96f84a4 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -2308,14 +2308,16 @@ void * os2_alloc(size_t bytes)
 #       endif
         GC_heap_bases[GC_n_heap_bases] = 0;
       }
-
-    // Avoiding the VirtualAlloc leak
-    } else {
+    } /* else */
+#   ifndef CYGWIN32
+      else {
+        /* Avoiding VirtualAlloc leak. */
         while (GC_n_heap_bases > 0) {
           VirtualFree(GC_heap_bases[--GC_n_heap_bases], 0, MEM_RELEASE);
           GC_heap_bases[GC_n_heap_bases] = 0;
         }
       }
+#   endif
   }
 #endif /* USE_WINALLOC || CYGWIN32 */