Subject: Re: bug#27416: [PROPOSED] Simplify malloc replacement on glibc

From: [email-masked]
Date: Sun, 18 Jun 2017 10:07:53 -0400

tags 27416 + patch
severity 27416 wishlist
quit

Paul Eggert <[email-masked]> writes:

> This avoids the need to build lib/e-gettime.o etc. on glibc
> platforms, as plain lib/gettime.o will do.

Could you add something like the summary you posted in
http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00351.html to
the commit message, I found the explanation here a bit confusing until I
read that.

    [Replace] Emacs's hybrid malloc implementation on GNUish platforms
    with a hybrid implementation that redefines malloc instead of
    re-#defining it.  That is, instead of defining a function
    hybrid_malloc that can call either gmalloc or the system malloc (and
    using the macro "#define malloc hybrid_malloc" in Emacs code), Emacs
    defines a function malloc that can call either gmalloc or the system
    malloc (via the latter’s alternate name ‘__libc_malloc’), without
    using a macro.

    [T]he Emacs build process no longer needs to compile library files
    twice.  For example, it can simply build lib/gettime.o from
    lib/gettime.c, rather than having to build both lib/gettime.o and
    lib/e-gettime.o.  This is because there is only one malloc symbol
    used by Emacs code, not two.

    The hybrid malloc approach would not change on non-GNUish platforms.