From 7b8c3d9260476b208784369d16dd19ed47e7f906 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 23 Dec 2012 16:03:36 +0400 Subject: [PATCH] Fix GC_win32_free_heap compilation error for Cygwin (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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/os_dep.c b/os_dep.c index 2074f465..05858021 100644 --- 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 */ -- 2.40.0