fi])
doug_lea_malloc=$emacs_cv_var_doug_lea_malloc
-system_malloc=$emacs_cv_sanitize_address
-
hybrid_malloc=
+system_malloc=yes
case "$opsys" in
## darwin ld insists on the use of malloc routines in the System framework.
- darwin | mingw32 | nacl | sol2-10) system_malloc=yes ;;
+ darwin | mingw32 | nacl | sol2-10) ;;
cygwin) hybrid_malloc=yes;;
+ *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;;
esac
if test "${system_malloc}" != yes && test "${doug_lea_malloc}" != yes \
AC_CHECK_MEMBERS([struct unipair.unicode], [], [], [[#include <linux/kd.h>]])
-AC_CHECK_FUNCS_ONCE(tzset)
+AC_CHECK_FUNCS_ONCE([sbrk tzset])
ok_so_far=yes
AC_CHECK_FUNC(socket, , ok_so_far=no)
#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)
if (! initialized)
{
+#ifdef GNU_LINUX
my_heap_start ();
+#endif
malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
}
else
{
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
if (old_bss_index == -1)
fatal ("no bss section found");
+#ifdef HAVE_SBRK
new_break = sbrk (0);
+#else
+ new_break = (byte *) old_bss_addr + old_bss_size;
+#endif
new_bss_addr = (ElfW (Addr)) new_break;
bss_size_growth = new_bss_addr - old_bss_addr;
new_data2_size = bss_size_growth;