Always use the system malloc (removes gmalloc.c malloc.c).
authorSteve Youngs <steve@sxemacs.org>
Sun, 26 May 2019 06:15:34 +0000 (16:15 +1000)
committerSteve Youngs <steve@sxemacs.org>
Sun, 26 May 2019 06:15:34 +0000 (16:15 +1000)
commit000f846876d84adf1a71f72a129b072593893c5b
tree1cc8ac18e477315eeb8ee25bfaa8b0651d00629b
parent8bda9b596c482119b1c43d6af218157a13e6c2dc
Always use the system malloc (removes gmalloc.c malloc.c).

This changeset removes our in-house malloc.c and gmalloc.c and switches to
always using the system provided malloc.

* src/mem/gmalloc.c: Removed.

* src/mem/malloc.c: Removed.

* info/internals/internals.texi (Low-Level Modules): Nuke
descriptions for gmalloc.c and malloc.c, update description for
free-hook.c

* src/ui/X11/device-x.c (x_delete_device): 'FREE_CHECKING' is
never defined and __free_hook is never used so remove crusty bits
of code conditional to it.

* src/mem/Makefile.am (EXTRA_libmemalloc_a_SOURCES): Remove
gmalloc.c and malloc.c.

* src/mem/free-hook.c: Remove all of the old gmalloc debugging
stuff.

* src/mem/ralloc.c: Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.
(Free_Addr_Block): Use void because caddr_t hasn't been a thing
for at least a hundred years.

* src/regex.c: Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.

* src/alloc.c: Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.
Ditto for GNU_MALLOC.
(malloced_storage_size): Because it's always system malloc, update
this to use GNU malloc accounting when on a glibc system.

* m4/sxe-summary.m4 (SXE_SUMMARY): It's always system malloc now
so no need to say if GNU malloc is used.

* src/emacs.c (main): Use HAVE_MALLOC_WARNING instead of
_NO_MALLOC_WARNING_
Use HAVE_GLIBC instead of DOUG_LEA_MALLOC.
(Fdump_emacs): Don't use disable_free_hook().

* src/mem/vm-limit.c: Use HAVE_MALLOC_WARNING instead of
_NO_MALLOC_WARNING_ and reverse the condition sense.

* m4/sxe-libc.m4 (SXE_CHECK_LIBC): Define HAVE_GLIBC.

* configure.ac: Removed  --with-dlmalloc, --with-system-malloc
Define HAVE_MALLOC_WARNING instead of _NO_MALLOC_WARNING_.
Remove check for malloc_set_state() it's not used anywhere.
Don't give reasons why or not GNU malloc is used because it's
not.
Don't define DOUG_LEA_MALLOC.
Don't add gmalloc.o or malloc.o to MEMALLOC_OBJS.
Define HAVE_LIBMCHECK.
Add -lmcheck to MEMALLOC_LIBS.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
14 files changed:
configure.ac
info/internals/internals.texi
m4/sxe-libc.m4
m4/sxe-summary.m4
src/alloc.c
src/emacs.c
src/mem/Makefile.am
src/mem/free-hook.c
src/mem/gmalloc.c [deleted file]
src/mem/malloc.c [deleted file]
src/mem/ralloc.c
src/mem/vm-limit.c
src/regex.c
src/ui/X11/device-x.c