From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#9273: 23.3; malloc initialization should (sometimes) happen at runtime Date: Sat, 13 Aug 2011 15:19:05 -0400 Message-ID: References: <4E41940C.2010605@cornell.edu> <83zkjhxnty.fsf@gnu.org> <4E444D85.4090907@cornell.edu> <838vqzxgq1.fsf@gnu.org> <4E44FC1B.9010207@cornell.edu> <831uwqyidi.fsf@gnu.org> <4E451A1F.4060409@cornell.edu> <4E458BF4.9080108@cornell.edu> <83fwl5wxbz.fsf@gnu.org> <4E4680C4.6040605@cornell.edu> <83d3g9weza.fsf@gnu.org> <4E468FE5.100@cornell.edu> <4E469967.40201@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1313263180 32607 80.91.229.12 (13 Aug 2011 19:19:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2011 19:19:40 +0000 (UTC) Cc: "9273@debbugs.gnu.org" <9273@debbugs.gnu.org> To: Ken Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 13 21:19:36 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QsJk7-0003t9-70 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Aug 2011 21:19:35 +0200 Original-Received: from localhost ([::1]:37443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QsJk6-0007gK-AP for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Aug 2011 15:19:34 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:53479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QsJk3-0007g4-Dh for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2011 15:19:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QsJk2-00022w-GO for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2011 15:19:31 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QsJk2-00022s-DP for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2011 15:19:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QsJlV-0006Zw-UO; Sat, 13 Aug 2011 15:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Aug 2011 19:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9273 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9273-submit@debbugs.gnu.org id=B9273.131326324225263 (code B ref 9273); Sat, 13 Aug 2011 19:21:01 +0000 Original-Received: (at 9273) by debbugs.gnu.org; 13 Aug 2011 19:20:42 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QsJlC-0006ZP-82 for submit@debbugs.gnu.org; Sat, 13 Aug 2011 15:20:42 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QsJl8-0006ZH-MN for 9273@debbugs.gnu.org; Sat, 13 Aug 2011 15:20:39 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAFXNRk5FxKeo/2dsb2JhbABBDqdpeIFAAQEEAVYjBQsLDiYSFBgNJIgDuDaGRwSfboNhVA X-IronPort-AV: E=Sophos;i="4.67,367,1309752000"; d="scan'208";a="131053309" Original-Received: from 69-196-167-168.dsl.teksavvy.com (HELO ceviche.home) ([69.196.167.168]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 13 Aug 2011 15:19:05 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0A74F660CF; Sat, 13 Aug 2011 15:19:05 -0400 (EDT) In-Reply-To: <4E469967.40201@cornell.edu> (Ken Brown's message of "Sat, 13 Aug 2011 11:33:59 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 13 Aug 2011 15:21:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.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:50053 Archived-At: > Probably. That would keep me from having to get involved in the details of > how _heapinfo works, and it would probably be less error prone. So I would > do something like the following: > 1. Temporarily restore the pre-dump malloc state. > 2. Call xrealloc, getting storage of the new size in the old heap. > 3. Copy the contents into a temporary buffer, and then free the recently > allocated storage in the old heap. > 4. Restore the malloc state, call malloc, and then copy the contents of the > temporary buffer into the just-acquired storage in the new heap. > Is that what you had in mind? No, I meant, during initialization of Emacs, make sure we get the old _heapinfo state, so that malloc/realloc/... just works. Stefan