emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

simplify GNU Emacs builds by replacing malloc


From: Paul Eggert
Subject: simplify GNU Emacs builds by replacing malloc
Date: Sat, 17 Jun 2017 20:16:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

In Bug#27416 I propose replacing 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.

Under this proposal, the 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.

Although this change seems like an obvious win in that it should make Emacs a bit easier to build and debug, I’m mentioning it on emacs-devel first in case anyone sees a problem with it.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27416



reply via email to

[Prev in Thread] Current Thread [Next in Thread]