From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: simplify GNU Emacs builds by replacing malloc Date: Sat, 17 Jun 2017 20:16:47 -0700 Organization: UCLA Computer Science Department Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1497755841 28878 195.159.176.226 (18 Jun 2017 03:17:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Jun 2017 03:17:21 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 18 05:17:15 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dMQiA-000731-KH for ged-emacs-devel@m.gmane.org; Sun, 18 Jun 2017 05:17:14 +0200 Original-Received: from localhost ([::1]:36957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMQiE-00034G-1x for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2017 23:17:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMQi2-000347-2A for Emacs-devel@gnu.org; Sat, 17 Jun 2017 23:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMQhy-0005la-UA for Emacs-devel@gnu.org; Sat, 17 Jun 2017 23:17:06 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59432) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dMQhy-0005kk-OH for Emacs-devel@gnu.org; Sat, 17 Jun 2017 23:17:02 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8E75F1600EF for ; Sat, 17 Jun 2017 20:16:54 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Ii9KtDlDFyyQ for ; Sat, 17 Jun 2017 20:16:47 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BF7961600FE for ; Sat, 17 Jun 2017 20:16:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id io_FFRnaYflQ for ; Sat, 17 Jun 2017 20:16:47 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id A1C0F1600EF for ; Sat, 17 Jun 2017 20:16:47 -0700 (PDT) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215731 Archived-At: In Bug#27416 I propose replacing Emacs's hybrid malloc implementation on = GNUish=20 platforms with a hybrid implementation that redefines malloc instead of=20 re-#defining it. That is, instead of defining a function hybrid_malloc th= at can=20 call either gmalloc or the system malloc (and using the macro "#define ma= lloc=20 hybrid_malloc" in Emacs code), Emacs defines a function malloc that can c= all=20 either gmalloc or the system malloc (via the latter=E2=80=99s alternate n= ame=20 =E2=80=98__libc_malloc=E2=80=99), without using a macro. Under this proposal, the Emacs build process no longer needs to compile l= ibrary=20 files twice. For example, it can simply build lib/gettime.o from lib/gett= ime.c,=20 rather than having to build both lib/gettime.o and lib/e-gettime.o. This = is=20 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 Ema= cs a=20 bit easier to build and debug, I=E2=80=99m mentioning it on emacs-devel f= irst in case=20 anyone sees a problem with it. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D27416