aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2004-04-12 19:41:56 +0000
committerStefan Monnier2004-04-12 19:41:56 +0000
commitef6d103984bda3f14f3367382a9f1f08ce186230 (patch)
tree7b8a2204c09fdd31eab73ef8c14154bc596e472c /src
parenteff277312d77fb36dda8bb744d32ef380bddd002 (diff)
downloademacs-ef6d103984bda3f14f3367382a9f1f08ce186230.tar.gz
emacs-ef6d103984bda3f14f3367382a9f1f08ce186230.zip
(__default_morecore): Use bss_sbrk(), not __sbrk(), before Cygwin unexec.
Diffstat (limited to 'src')
-rw-r--r--src/gmalloc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 99fa36d073a..eae83a74eb6 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -352,6 +352,10 @@ Cambridge, MA 02139, USA.
352#include <errno.h> 352#include <errno.h>
353 353
354/* How to really get more memory. */ 354/* How to really get more memory. */
355#if defined(CYGWIN)
356extern __ptr_t bss_sbrk PP ((ptrdiff_t __size));
357extern int bss_sbrk_did_unexec;
358#endif
355__ptr_t (*__morecore) PP ((ptrdiff_t __size)) = __default_morecore; 359__ptr_t (*__morecore) PP ((ptrdiff_t __size)) = __default_morecore;
356 360
357/* Debugging hook for `malloc'. */ 361/* Debugging hook for `malloc'. */
@@ -1572,7 +1576,14 @@ __ptr_t
1572__default_morecore (increment) 1576__default_morecore (increment)
1573 __malloc_ptrdiff_t increment; 1577 __malloc_ptrdiff_t increment;
1574{ 1578{
1575 __ptr_t result = (__ptr_t) __sbrk (increment); 1579 __ptr_t result;
1580#if defined(CYGWIN)
1581 if (!bss_sbrk_did_unexec)
1582 {
1583 return bss_sbrk (increment);
1584 }
1585#endif
1586 result = (__ptr_t) __sbrk (increment);
1576 if (result == (__ptr_t) -1) 1587 if (result == (__ptr_t) -1)
1577 return NULL; 1588 return NULL;
1578 return result; 1589 return result;