OSDN Git Service

* heap.cc (heap_init): Only commit if allocsize is not zero.
authorcorinna <corinna>
Mon, 12 Jun 2006 13:59:14 +0000 (13:59 +0000)
committercorinna <corinna>
Mon, 12 Jun 2006 13:59:14 +0000 (13:59 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/heap.cc

index 288d214..b9eabbb 100644 (file)
@@ -1,3 +1,7 @@
+2006-06-12  Pierre Humblet  Pierre.Humblet@ieee.org
+
+       * heap.cc (heap_init): Only commit if allocsize is not zero.
+
 2006-06-12  Corinna Vinschen  <corinna@vinschen.de>
 
        * net.cc (fdsock): Disable raising buffer sizes.  Add comment to
index bdf7a75..63fc935 100644 (file)
@@ -83,7 +83,7 @@ heap_init ()
                   reserve_size, allocsize, page_const);
       if (p != cygheap->user_heap.base)
        api_fatal ("heap allocated at wrong address %p (mapped) != %p (expected)", p, cygheap->user_heap.base);
-      if (!VirtualAlloc (cygheap->user_heap.base, allocsize, MEM_COMMIT, PAGE_READWRITE))
+      if (allocsize && !VirtualAlloc (cygheap->user_heap.base, allocsize, MEM_COMMIT, PAGE_READWRITE))
        api_fatal ("MEM_COMMIT failed, %E");
     }