* cygheap.cc (_csbrk): Fix off-by-one error.

* cygwin.sc: Give .cygheap a minimum size of 512K.
This commit is contained in:
Corinna Vinschen 2007-01-12 19:40:20 +00:00
parent 5f77729c30
commit f51b396579
3 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-01-12 Corinna Vinschen <corinna@vinschen.de>
* cygheap.cc (_csbrk): Fix off-by-one error.
* cygwin.sc: Give .cygheap a minimum size of 512K.
2007-01-12 Christopher Faylor <me@cgf.cx> 2007-01-12 Christopher Faylor <me@cgf.cx>
* external.cc (sync_winenv): Use cur_environ () rather than * external.cc (sync_winenv): Use cur_environ () rather than

View File

@ -1,6 +1,6 @@
/* cygheap.cc: Cygwin heap manager. /* 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. This file is part of Cygwin.
@ -121,7 +121,7 @@ _csbrk (int sbs)
size_t granmask = getpagesize () - 1; size_t granmask = getpagesize () - 1;
char *newbase = nextpage (prebrk); char *newbase = nextpage (prebrk);
cygheap_max = (char *) cygheap_max + sbs; 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 */; /* nothing to do */;
else else
{ {

View File

@ -106,7 +106,7 @@ SECTIONS
{ {
__cygheap_mid = .; __cygheap_mid = .;
*(.cygheap) *(.cygheap)
. = . + 1; . = . + (512 * 1024);
. = ALIGN(512 * 1024); . = ALIGN(512 * 1024);
} }
__cygheap_end = ABSOLUTE(.); __cygheap_end = ABSOLUTE(.);