diff options
author | Christopher Faylor <me@cgf.cx> | 2005-09-02 04:46:51 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-09-02 04:46:51 +0000 |
commit | 7a1bf10a8433261a1dd4ae86b76750716d358569 (patch) | |
tree | b7afc8189706eba8c9e0ccca56ca61c7cda00013 /winsup/cygwin/heap.cc | |
parent | 062c2fa42f64aef80615e433af44028332b34ca8 (diff) | |
download | cygnal-7a1bf10a8433261a1dd4ae86b76750716d358569.tar.gz cygnal-7a1bf10a8433261a1dd4ae86b76750716d358569.tar.bz2 cygnal-7a1bf10a8433261a1dd4ae86b76750716d358569.zip |
bad_addresses
Diffstat (limited to 'winsup/cygwin/heap.cc')
-rw-r--r-- | winsup/cygwin/heap.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/heap.cc b/winsup/cygwin/heap.cc index 9f86f9911..bd1b2e3c2 100644 --- a/winsup/cygwin/heap.cc +++ b/winsup/cygwin/heap.cc @@ -34,9 +34,11 @@ extern "C" size_t getpagesize (); void heap_init () { +static int seen = 0; /* If we're the forkee, we must allocate the heap at exactly the same place as our parent. If not, we don't care where it ends up. */ +seen++; page_const = system_info.dwPageSize; if (!cygheap->user_heap.base) { @@ -73,11 +75,11 @@ heap_init () MEM_RESERVE, PAGE_READWRITE); if (p) break; - if ((reserve_size -= page_const) <= allocsize) + if ((reserve_size -= page_const) < allocsize) break; } if (!p) - api_fatal ("couldn't allocate cygwin heap, %E, base %p, top %p, " + api_fatal ("couldn't allocate heap, %E, base %p, top %p, " "reserve_size %d, allocsize %d, page_const %d", cygheap->user_heap.base, cygheap->user_heap.top, reserve_size, allocsize, page_const); |