all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Toby Cubitt <toby-dated-1274016172.cb9db0@dr-qubit.org>
Cc: emacs-devel@gnu.org
Subject: Re: [LONG] undo-tree and garbage collection: a request for advice from the gurus
Date: Sun, 02 May 2010 15:47:12 -0400	[thread overview]
Message-ID: <jwviq76t7eb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20100502132757.GA2425@c3po> (Toby Cubitt's message of "Sun, 2 May 2010 14:27:57 +0100")

> 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




  reply	other threads:[~2010-05-02 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-02 13:27 [LONG] undo-tree and garbage collection: a request for advice from the gurus Toby Cubitt
2010-05-02 19:47 ` Stefan Monnier [this message]
2010-05-03 13:17   ` Toby Cubitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwviq76t7eb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=toby-dated-1274016172.cb9db0@dr-qubit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.