From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert 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 14:33:22 -0800 Organization: UCLA Computer Science Department Message-ID: <56772CB2.8060004@cs.ucla.edu> References: <85poynxvgy.fsf@iznogoud.viz> <567120C0.6080803@cs.ucla.edu> <85h9jhdxl2.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1450650862 23946 80.91.229.3 (20 Dec 2015 22:34:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Dec 2015 22:34:22 +0000 (UTC) Cc: Rich Felker , 22086@debbugs.gnu.org To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 20 23:34:11 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 1aAmYL-0006vb-Up for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Dec 2015 23:34:10 +0100 Original-Received: from localhost ([::1]:42250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAmYL-0006cw-5S for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Dec 2015 17:34:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAmYH-0006cq-ST for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 17:34:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAmYE-0004mV-M3 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 17:34:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAmYE-0004mL-J9 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 17:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aAmYE-0000nY-7c for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 17:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Dec 2015 22:34:02 +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.14506508113032 (code B ref 22086); Sun, 20 Dec 2015 22:34:02 +0000 Original-Received: (at 22086) by debbugs.gnu.org; 20 Dec 2015 22:33:31 +0000 Original-Received: from localhost ([127.0.0.1]:58336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aAmXj-0000mq-MC for submit@debbugs.gnu.org; Sun, 20 Dec 2015 17:33:31 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:51273) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aAmXh-0000md-Jo for 22086@debbugs.gnu.org; Sun, 20 Dec 2015 17:33:30 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 59B73160017; Sun, 20 Dec 2015 14:33:23 -0800 (PST) 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 TvhtL10BQONv; Sun, 20 Dec 2015 14:33:22 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9C05E160193; Sun, 20 Dec 2015 14:33:22 -0800 (PST) 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 CfAD4QCANagg; Sun, 20 Dec 2015 14:33:22 -0800 (PST) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 7934C160017; Sun, 20 Dec 2015 14:33:22 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <85h9jhdxl2.fsf@iznogoud.viz> 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:110216 Archived-At: 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.