From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [LONG] undo-tree and garbage collection: a request for advice from the gurus Date: Sun, 02 May 2010 15:47:12 -0400 Message-ID: References: <20100502132757.GA2425@c3po> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272829645 27055 80.91.229.12 (2 May 2010 19:47:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 May 2010 19:47:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Toby Cubitt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 02 21:47:24 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8f8O-0007cS-08 for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 21:47:24 +0200 Original-Received: from localhost ([127.0.0.1]:45063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8f8N-0002OM-Bz for ged-emacs-devel@m.gmane.org; Sun, 02 May 2010 15:47:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8f8I-0002Nk-VE for emacs-devel@gnu.org; Sun, 02 May 2010 15:47:18 -0400 Original-Received: from [140.186.70.92] (port=41985 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8f8F-0002La-Fw for emacs-devel@gnu.org; Sun, 02 May 2010 15:47:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8f8E-0007is-59 for emacs-devel@gnu.org; Sun, 02 May 2010 15:47:15 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:39518 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8f8E-0007ic-2V for emacs-devel@gnu.org; Sun, 02 May 2010 15:47:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAM5z3UvO+KoL/2dsb2JhbACdI3K3boUSBIwo X-IronPort-AV: E=Sophos;i="4.52,314,1270440000"; d="scan'208";a="63119152" Original-Received: from 206-248-170-11.dsl.teksavvy.com (HELO pastel.home) ([206.248.170.11]) by ironport2-out.pppoe.ca with ESMTP; 02 May 2010 15:47:12 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 5FEAF82C3; Sun, 2 May 2010 15:47:12 -0400 (EDT) In-Reply-To: <20100502132757.GA2425@c3po> (Toby Cubitt's message of "Sun, 2 May 2010 14:27:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124439 Archived-At: > I spent quite a lot of time re-implementing `undo-tree-mode' so that > rather than transferring undo data out of `buffer-undo-list', > `buffer-undo-tree' instead stored pointers to undo changesets in > `buffer-undo-list'...only to eventually realise that this wasn't going to > solve anything! It'll work but only if your references into buffer-undo-list are weak (i.e. they don't prevent the pointed elements from being GC'd). For undo-equiv-table I do that by using a weak hash-table: (defconst undo-equiv-table (make-hash-table :test 'eq :weakness t) -- Stefan