diff options
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | src/gmalloc.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index d397e8fa7e1..5579342c4e5 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -2218,7 +2218,7 @@ test "$CANNOT_DUMP" = yes || | |||
| 2218 | case "$opsys" in | 2218 | case "$opsys" in |
| 2219 | ## darwin ld insists on the use of malloc routines in the System framework. | 2219 | ## darwin ld insists on the use of malloc routines in the System framework. |
| 2220 | darwin | mingw32 | nacl | sol2-10) ;; | 2220 | darwin | mingw32 | nacl | sol2-10) ;; |
| 2221 | cygwin | qnxto) | 2221 | cygwin | qnxto | freebsd) |
| 2222 | hybrid_malloc=yes | 2222 | hybrid_malloc=yes |
| 2223 | system_malloc= ;; | 2223 | system_malloc= ;; |
| 2224 | *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; | 2224 | *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; |
diff --git a/src/gmalloc.c b/src/gmalloc.c index 2bda95ebd3d..a17d39c1eeb 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -1502,17 +1502,18 @@ extern void *__sbrk (ptrdiff_t increment); | |||
| 1502 | static void * | 1502 | static void * |
| 1503 | gdefault_morecore (ptrdiff_t increment) | 1503 | gdefault_morecore (ptrdiff_t increment) |
| 1504 | { | 1504 | { |
| 1505 | void *result; | ||
| 1506 | #ifdef HYBRID_MALLOC | 1505 | #ifdef HYBRID_MALLOC |
| 1507 | if (!DUMPED) | 1506 | if (!DUMPED) |
| 1508 | { | 1507 | { |
| 1509 | return bss_sbrk (increment); | 1508 | return bss_sbrk (increment); |
| 1510 | } | 1509 | } |
| 1511 | #endif | 1510 | #endif |
| 1512 | result = (void *) __sbrk (increment); | 1511 | #ifdef HAVE_SBRK |
| 1513 | if (result == (void *) -1) | 1512 | void *result = (void *) __sbrk (increment); |
| 1514 | return NULL; | 1513 | if (result != (void *) -1) |
| 1515 | return result; | 1514 | return result; |
| 1515 | #endif | ||
| 1516 | return NULL; | ||
| 1516 | } | 1517 | } |
| 1517 | 1518 | ||
| 1518 | void *(*__morecore) (ptrdiff_t) = gdefault_morecore; | 1519 | void *(*__morecore) (ptrdiff_t) = gdefault_morecore; |