From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.emacs.bugs Subject: bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid malloc patch for elf systems Date: Sun, 20 Dec 2015 20:59:52 -0500 Message-ID: <20151221015952.GU238@brightrain.aerifal.cx> References: <85poynxvgy.fsf@iznogoud.viz> <567120C0.6080803@cs.ucla.edu> <85h9jhdxl2.fsf@iznogoud.viz> <56772CB2.8060004@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1450663281 14119 80.91.229.3 (21 Dec 2015 02:01:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Dec 2015 02:01:21 +0000 (UTC) Cc: Wolfgang Jenkner , 22086@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 21 03:01:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aApmg-0002RX-Dg for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Dec 2015 03:01:10 +0100 Original-Received: from localhost ([::1]:42708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aApmf-0006Qi-M9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Dec 2015 21:01:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aApmb-0006Qb-Jc for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:01:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aApmY-0006eu-Cf for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:01:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aApmY-0006eL-9W for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aApmX-0005ps-Sh for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rich Felker Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Dec 2015 02:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22086-submit@debbugs.gnu.org id=B22086.145066321322364 (code B ref 22086); Mon, 21 Dec 2015 02:01:01 +0000 Original-Received: (at 22086) by debbugs.gnu.org; 21 Dec 2015 02:00:13 +0000 Original-Received: from localhost ([127.0.0.1]:58415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aApll-0005oe-0L for submit@debbugs.gnu.org; Sun, 20 Dec 2015 21:00:13 -0500 Original-Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:42170 helo=brightrain.aerifal.cx) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aApli-0005oT-1T for 22086@debbugs.gnu.org; Sun, 20 Dec 2015 21:00:11 -0500 Original-Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1aAplQ-0003yS-00; Mon, 21 Dec 2015 01:59:52 +0000 Content-Disposition: inline In-Reply-To: <56772CB2.8060004@cs.ucla.edu> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:110222 Archived-At: On Sun, Dec 20, 2015 at 02:33:22PM -0800, Paul Eggert wrote: > While thinking over this patch I'd like to propose what should be a > simpler approach. This new proposal is more radical, and so should > not be applied to the emacs-25 branch, but it should make the port > to musl etc. automatic. > > The simpler approach is to remove gmalloc.c, and to use the system > memory allocator, i.e., to behave as if SYSTEM_MALLOC is defined on > all platforms. > > We can still support hybrid malloc for Cygwin, if SYSTEM_MALLOC > wouldn't work on Cygwin for some reason; and we can support the > similar hybrid on Darwin, if it's still needed. But in neither > approach should we override the system malloc; any Emacs-specific > allocation function we define should be called (say) emalloc instead > of malloc, so that it does not conflict with the system malloc. That > way, we don't have to worry about name-space collisions, either at > compile-time or at link-time. > > If I'm wrong about gmalloc.c and it is still needed on some > platforms for some reason, we can continue to use it, but it should > define emalloc etc., and not attempt to override the C standard > library. > > Long ago as I recall, we really needed to override the C standard > library on some platforms, due to the funny way in which undumped > storage was made read-only. That need is obsolete, though, which > should let us simplify things now. I don't object to this change if you can reliably ensure that nothing in the pre-dump emacs will call malloc. When I looked, though, this seemed to be very difficult; I had been looking (albeit casually) for a clean solution to this problem for nearly a decade before hybrid malloc showed up. Unless there's a quick solution I think switching to hybrid malloc would be a first good step, but I like eliminating gmalloc.c better. Rich