GNU bug report logs - #69706
30.0.50; sort.c, unnecessary GC marking

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Sun, 10 Mar 2024 08:46:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 30.1

Done: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 69706 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 69706 <at> debbugs.gnu.org
Subject: Re: bug#69706: 30.0.50; sort.c, unnecessary GC marking
Date: Sun, 10 Mar 2024 14:38:38 +0100
10 mars 2024 kl. 12.29 skrev Gerd Möllmann <gerd.moellmann <at> gmail.com>:

> You nean sort.c is removing objects temporarily from the vector, so that
> they are not reachable from any other root, especially from the control
> stack? Could be, the code is a bit hard to follow.

The comment in cleanup_mem is explicit about this:

>   /* If we have an exception while merging, some of the list elements
>      might only live in temp storage; we copy everything remaining in
>      the temp storage back into the original list.  This ensures that
>      the original list has all of the original elements, although
>      their order is unpredictable.  */


> Please make it easy for a concurrent, mostly-copying GC, use the stack

We can't use the C stack for allocations of arbitrary size, unfortunately.

Furthermore, we currently make the (correct) assumption that explicit xmalloc/xfree for temporary storage is faster than allocating a Lisp vector in most places. If a new GC shrinks the performance gap sufficiently, then we could reconsider that.

See bug#69709 for the new `sort` plan.





This bug report was last modified 1 year and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.