[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master d6585a9 04/15: Add musl patch to support HYBRID_MAL
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master d6585a9 04/15: Add musl patch to support HYBRID_MALLOC on elf systems |
Date: |
Sat, 30 Jan 2016 23:26:15 +0000 |
branch: master
commit d6585a910ed3e9e0e43c093b5fbfeb6d56b703b4
Author: Wolfgang Jenkner <address@hidden>
Commit: Paul Eggert <address@hidden>
Add musl patch to support HYBRID_MALLOC on elf systems
* src/gmalloc.c: Adjust for HYBRID_MALLOC in the non CYGWIN case.
(__default_morecore): Here, in particular.
* configure.ac: Define HYBRID_MALLOC when unexelf.o is used.
New variable SHEAP_OBJ.
* src/Makefile.in: Use it.
(Bug#22086)
---
configure.ac | 12 ++++++++++--
src/Makefile.in | 6 +++++-
src/gmalloc.c | 4 ++--
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4a0dc56..cd3a9bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2121,7 +2121,13 @@ case "$opsys" in
cygwin) hybrid_malloc=yes;;
esac
+if test "${system_malloc}" != yes && test "${doug_lea_malloc}" != yes \
+ && test "${UNEXEC_OBJ}" = unexelf.o && test "${hybrid_malloc}" != no; then
+ hybrid_malloc=yes
+fi
+
GMALLOC_OBJ=
+SHEAP_OBJ=
if test "${system_malloc}" = "yes"; then
AC_DEFINE([SYSTEM_MALLOC], 1,
[Define to 1 to use the system memory allocator, even if it is not
@@ -2136,6 +2142,7 @@ elif test "$hybrid_malloc" = yes; then
GNU_MALLOC=
GNU_MALLOC_reason="only before dumping"
GMALLOC_OBJ=gmalloc.o
+ SHEAP_OBJ=sheap.o
VMLIMIT_OBJ=
else
test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
@@ -2156,9 +2163,10 @@ else
fi
fi
AC_SUBST(GMALLOC_OBJ)
+AC_SUBST(SHEAP_OBJ)
AC_SUBST(VMLIMIT_OBJ)
-if test "$doug_lea_malloc" = "yes" ; then
+if test "$doug_lea_malloc" = "yes" && test "$hybrid_malloc" != yes; then
if test "$GNU_MALLOC" = yes ; then
GNU_MALLOC_reason="
(Using Doug Lea's new malloc from the GNU C Library.)"
@@ -5035,7 +5043,7 @@ fi
AC_SUBST(RALLOC_OBJ)
if test "$opsys" = "cygwin"; then
- CYGWIN_OBJ="sheap.o cygw32.o"
+ CYGWIN_OBJ="cygw32.o"
## Cygwin differs because of its unexec().
PRE_ALLOC_OBJ=
POST_ALLOC_OBJ=lastfile.o
diff --git a/src/Makefile.in b/src/Makefile.in
index 6a31542..e59d3b1 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -254,7 +254,10 @@ XFIXES_CFLAGS = @XFIXES_CFLAGS@
## widget.o if USE_X_TOOLKIT, otherwise empty.
address@hidden@
-## sheap.o if CYGWIN, otherwise empty.
+## sheap.o if HYBRID_MALLOC, otherwise empty.
address@hidden@
+
+## cygw32.o if CYGWIN, otherwise empty.
address@hidden@
## fontset.o fringe.o image.o if we have any window system
@@ -397,6 +400,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o
$(XMENU_OBJ) window.o \
doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
$(XWIDGETS_OBJ) \
profiler.o decompress.o \
+ $(SHEAP_OBJ) \
$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
$(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
obj = $(base_obj) $(NS_OBJC_OBJ)
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 72d65af..30e0131 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -70,7 +70,7 @@ extern void emacs_abort (void);
#define aligned_alloc galigned_alloc
#define free gfree
-#ifdef CYGWIN
+#ifdef HYBRID_MALLOC
extern void *bss_sbrk (ptrdiff_t size);
extern int bss_sbrk_did_unexec;
extern char bss_sbrk_buffer[];
@@ -1542,7 +1542,7 @@ void *
__default_morecore (ptrdiff_t increment)
{
void *result;
-#if defined (CYGWIN)
+#ifdef HYBRID_MALLOC
if (!DUMPED)
{
return bss_sbrk (increment);
- [Emacs-diffs] master updated (935b4d0 -> 692e410), Paul Eggert, 2016/01/30
- [Emacs-diffs] master dec1390 03/15: unexelf.c hook to support HYBRID_MALLOC on ELF, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 874c59a 06/15: Report static heap usage on non-Cygwin, too, Paul Eggert, 2016/01/30
- [Emacs-diffs] master a5f8586 02/15: Link temacs with gnulib compiled with -Demacs, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 384ffef 05/15: Pacify GCC on extern decls, Paul Eggert, 2016/01/30
- [Emacs-diffs] master d6585a9 04/15: Add musl patch to support HYBRID_MALLOC on elf systems,
Paul Eggert <=
- [Emacs-diffs] master cb22fce 01/15: Internal linkage for gmalloc etc. if HYBRID_MALLOC, Paul Eggert, 2016/01/30
- [Emacs-diffs] master e4cd4a7 08/15: * src/alloc.c: Include "sheap.h"., Paul Eggert, 2016/01/30
- [Emacs-diffs] master e1a9f20 07/15: Pacify --enable-gcc-warnings when HYBRID_MALLOC, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 2ee2963 12/15: Shrink static heap a bit, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 370a260 14/15: Make it easy to override preferred-branch test, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 3d82a8e 11/15: Fix extern symbols defined and not used, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 7fdc3cf 10/15: Build lib/e-*.o only on platforms that need it, Paul Eggert, 2016/01/30
- [Emacs-diffs] master a4817d8 09/15: Include <malloc.h> when advisable, Paul Eggert, 2016/01/30
- [Emacs-diffs] master 692e410 15/15: Tell Automake the new lib/Makefile.am is OK, Paul Eggert, 2016/01/30
- [Emacs-diffs] master ffbf163 13/15: ; Try to clean up ChangeLog.2 mess created by merge., Paul Eggert, 2016/01/30