summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-11-08 09:48:53 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2016-11-08 09:49:27 -0800
commit3b5e6774ed9743fb726ac8c15341eaa09375cfbf (patch)
tree08e5246f9f6311936689479346be05b801db4cf0 /src/alloc.c
parent86baa208f84597068b3d55420eae0100a59e44b7 (diff)
downloademacs-3b5e6774ed9743fb726ac8c15341eaa09375cfbf.tar.gz
emacs-3b5e6774ed9743fb726ac8c15341eaa09375cfbf.tar.bz2
emacs-3b5e6774ed9743fb726ac8c15341eaa09375cfbf.zip
Port to FreeBSD 11 AMD
Problem reported by Ashish Shukla (Bug#24892). I tested this on FreeBSD 11 x86-64 with HAVE_SBRK manually undefined. * configure.ac (system_malloc): Set to 'yes' if there is no sbrk. (sbrk): Check whether it exists. * src/alloc.c (my_heap_start) [!GNU_LINUX]: Do not define, since this function is now used only on GNU/Linux, and sbrk might not exist on other platforms. (malloc_initialize_hook) [!GNU_LINUX]: Do not call my_heap_start, since its side effect will never be used. (Fmemory_limit) [!HAVE_SBRK]: Do not call sbrk. * src/unexelf.c (unexec) [!HAVE_SBRK]: Assume that nothing like sbrk exists.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c
index a58dc13cbd7..90c6f9441fa 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -97,7 +97,7 @@ static bool valgrind_p;
#include "w32heap.h" /* for sbrk */
#endif
-#if defined DOUG_LEA_MALLOC || defined GNU_LINUX
+#ifdef GNU_LINUX
/* The address where the heap starts. */
void *
my_heap_start (void)
@@ -130,7 +130,9 @@ malloc_initialize_hook (void)
if (! initialized)
{
+#ifdef GNU_LINUX
my_heap_start ();
+#endif
malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
}
else
@@ -7053,7 +7055,7 @@ We divide the value by 1024 to make sure it fits in a Lisp integer. */)
{
Lisp_Object end;
-#ifdef HAVE_NS
+#if defined HAVE_NS || !HAVE_SBRK
/* Avoid warning. sbrk has no relation to memory allocated anyway. */
XSETINT (end, 0);
#else