Subject: bug#46836: 28.0.50; Clean up obsolete comment for unchain_marker

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 01 Mar 2021 14:29:49 +0100

Matt Armstrong <[email-masked]> writes:

> I wondered why there was a scare comment for unchain_marker, when the
> code itself did not look like it was especially different from the other
> nearby functions.  It turns out that the call into this function from GC
> was removed a few years ago.

[...]

> -/* Remove MARKER from the chain of whatever buffer it is in,
> -   leaving it points to nowhere.  This is called during garbage
> -   collection, so we must be careful to ignore and preserve
> -   mark bits, including those in chain fields of markers.  */
> +/* Remove MARKER from the chain of whatever buffer it is in.  Set its
> +   buffer NULL.  */

Thanks; applied to Emacs 28.

Looking at the code in unchain_marker, I was a bit confused, because the
code looks very straightforward?  I wondered whether the function could
also be simplified now that it doesn't have to preserve mark bits...

But all the special mark bit code was removed from this code a couple
decades ago.  :-)

commit 5e097e002ba08205c8a4643b3495dbd45462147f
Author:     Stefan Monnier <[email-masked]>
AuthorDate: Thu Jun 26 23:17:50 2003 +0000

...

 	  else
-	    {
-	      omark = XMARKBIT (XMARKER (prev)->chain);
-	      XMARKER (prev)->chain = next;
-	      XSETMARKBIT (XMARKER (prev)->chain, omark);
-	    }

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no