GNU bug report logs - #78943
feature/igc [PATCH] Trace current minor maps exactly

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Wed, 2 Jul 2025 12:29:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Helmut Eller <eller.helmut <at> gmail.com>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 78943 <at> debbugs.gnu.org
Subject: bug#78943: feature/igc [PATCH] Trace current minor maps exactly
Date: Tue, 15 Jul 2025 19:12:05 +0200
[Message part 1 (text/plain, inline)]
On Sat, Jul 12 2025, Pip Cet wrote:

> Thanks.  It'd be nice to have a more general approach to growable
> vectors, but in this case, I don't understand why we use array
> structures at all: two simple linked lists should work just as well.

It seems that arrays are used because in some places the active minor
maps need to be processed in the reversed order from the order they are
stored in minor-mode-map-alist.

[...]
> My idea still would be to grow a vector aggressively until it's large
> enough to fit all elements, then "truncate" it in place in such a way
> that the GC knows to shrink it when it gets copied to the next
> generation.

This could work with MPS but I'm not so sure about the classic GC.

Here is a bit a different approach that doesn't use the cmm_vector:

  1. adds some test cases for the following changes

  2. uses Fcurrent_active_maps in keyboard.c and replaces the duplicated
     code with a common function

  3. replaces the remaining uses of current_minor_maps with
     functions that create some temporary lists

  4. This is an optional improvement for 2, if we are hellbent on
     avoiding consing & reversing the list returned from
     Fcurrent_active_maps.  This patch avoids the list at the cost of
     some complexity and alloca.

[0001-Add-some-minor-mode-keymap-related-tests.patch (text/x-diff, attachment)]
[0002-Refactor-menu_bar_items-tab_bar_items-and-tool_bar_i.patch (text/x-diff, attachment)]
[0003-Eliminate-the-global-arrays-cmm_modes-and-cmm_maps.patch (text/x-diff, attachment)]
[0004-In-menu_bar_items-avoid-consing-reversing-the-list-o.patch (text/x-diff, attachment)]

This bug report was last modified 66 days ago.

Previous Next


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