From 6772e4c9e9160919374c0597fafb8e9fa76d9ddd Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 12 Sep 2005 03:55:16 +0000 Subject: [PATCH] * heap.cc (heap_init): Allocate heap from top down as a hedge against subsequent ERROR_INVALID_ADDRESS in forked processes when CTRL-C is pressed. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/heap.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8520bc91d..781b134c4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2005-09-11 Christopher Faylor + + * heap.cc (heap_init): Allocate heap from top down as a hedge against + subsequent ERROR_INVALID_ADDRESS in forked processes when CTRL-C is + pressed. + 2005-09-09 Christopher Faylor * heap.cc (heap_init): Be slightly more aggressive when trying to diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc index 739b59711..7dd74979c 100644 --- a/winsup/cygwin/heap.cc +++ b/winsup/cygwin/heap.cc @@ -47,7 +47,7 @@ heap_init () * to assure contiguous memory. */ cygheap->user_heap.ptr = cygheap->user_heap.top = cygheap->user_heap.base = - VirtualAlloc (NULL, cygheap->user_heap.chunk, MEM_RESERVE, PAGE_NOACCESS); + VirtualAlloc (NULL, cygheap->user_heap.chunk, MEM_RESERVE | MEM_TOP_DOWN, PAGE_NOACCESS); if (cygheap->user_heap.base) break; cygheap->user_heap.chunk -= 1 * 1024 * 1024;