diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8a43e89a8..bbe8e4f62 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2007-01-12 Corinna Vinschen + + * cygheap.cc (_csbrk): Fix off-by-one error. + * cygwin.sc: Give .cygheap a minimum size of 512K. + 2007-01-12 Christopher Faylor * external.cc (sync_winenv): Use cur_environ () rather than diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index 9b98b346a..caeda7b3a 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -1,6 +1,6 @@ /* cygheap.cc: Cygwin heap manager. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. This file is part of Cygwin. @@ -121,7 +121,7 @@ _csbrk (int sbs) size_t granmask = getpagesize () - 1; char *newbase = nextpage (prebrk); cygheap_max = (char *) cygheap_max + sbs; - if (!sbs || (newbase > cygheap_max) || (cygheap_max < _cygheap_end)) + if (!sbs || (newbase >= cygheap_max) || (cygheap_max <= _cygheap_end)) /* nothing to do */; else { diff --git a/winsup/cygwin/cygwin.sc b/winsup/cygwin/cygwin.sc index 58ee37664..6247e86cc 100644 --- a/winsup/cygwin/cygwin.sc +++ b/winsup/cygwin/cygwin.sc @@ -106,7 +106,7 @@ SECTIONS { __cygheap_mid = .; *(.cygheap) - . = . + 1; + . = . + (512 * 1024); . = ALIGN(512 * 1024); } __cygheap_end = ABSOLUTE(.);