From: Stefan Monnier Date: Mon, 12 Apr 2004 19:41:56 +0000 (+0000) Subject: (__default_morecore): Use bss_sbrk(), not __sbrk(), before Cygwin unexec. X-Git-Tag: ttn-vms-21-2-B4~6875 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef6d103984bda3f14f3367382a9f1f08ce186230;p=emacs.git (__default_morecore): Use bss_sbrk(), not __sbrk(), before Cygwin unexec. --- 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. #include /* How to really get more memory. */ +#if defined(CYGWIN) +extern __ptr_t bss_sbrk PP ((ptrdiff_t __size)); +extern int bss_sbrk_did_unexec; +#endif __ptr_t (*__morecore) PP ((ptrdiff_t __size)) = __default_morecore; /* Debugging hook for `malloc'. */ @@ -1572,7 +1576,14 @@ __ptr_t __default_morecore (increment) __malloc_ptrdiff_t increment; { - __ptr_t result = (__ptr_t) __sbrk (increment); + __ptr_t result; +#if defined(CYGWIN) + if (!bss_sbrk_did_unexec) + { + return bss_sbrk (increment); + } +#endif + result = (__ptr_t) __sbrk (increment); if (result == (__ptr_t) -1) return NULL; return result;