emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reachable killed buffers


From: Stefan Monnier
Subject: Re: Reachable killed buffers
Date: Mon, 10 Sep 2012 16:15:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> Like this?

That sounds about right, yes.  Tho, I'd introduce a BUFFER_LIVE_P macro
to make the code more clear.

Also, I'm not 100% sure the specific code you show is safe, because
modifying the graph of objects during GC is always risky.

I'm fairly confident that the call to window_drain_buffer_lists is safe,
but for swap_in_global_binding is seems a bit less obvious since it
might modify objects we may have marked already, but I think it's OK
as well.  But please add comments to those functions indicating the
constraints that they need to satisfy.

>             struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr);
> -           /* If the value is forwarded to a buffer or keyboard field,
> -              these are marked when we see the corresponding object.
> -              And if it's forwarded to a C variable, either it's not
> -              a Lisp_Object var, or it's staticpro'd already.  */
> +           /* If the value is set up for a killed buffer or deleted
> +              frame, restore it's global binding.  */
> +           if (orphaned_local_binding (blv))
> +             swap_in_global_binding (ptr);

I don't see any reason to remove the previous comment since the change
doesn't affect its validity.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]