Subject: Re: bug#76538: 31.0.50; 31.0.50; 31.0.50; feature/igc: using magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) in some random ways blocks GNU Emacs.

From: Helmut Eller <[email-masked]>
Date: Sat, 01 Mar 2025 17:59:37 +0100

On Fri, Feb 28 2025, Gerd Möllmann wrote:

> +static void
> +unchain (struct Lisp_Vector *v, int slot)
> +{
> +  IGC_MA_MARKER (v, slot) = IGC_MA_FREE_LIST (v);
> +  IGC_MA_FREE_LIST (v) = make_fixnum (slot);
> +
> +  int prev = XFIXNUM (IGC_MA_PREV (v, slot));
> +  if (prev >= 0)
> +    IGC_MA_NEXT (v, prev) = IGC_MA_NEXT (v, slot);
> +  else
> +    IGC_MA_HEAD (v) = IGC_MA_NEXT (v, slot);
> +
> +  int next = XFIXNUM (IGC_MA_NEXT (v, slot));
> +  if (next >= 0)
> +    IGC_MA_PREV (v, next) = IGC_MA_PREV (v, slot);
> +}

Doing this in the collector looks quite risky.  It seems to assume that
the mutator is not in the middle of reading from or writing to any of
the involved slots.

Helmut