emacs-devel
[Top][All Lists]
Advanced

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

Re: Reachable killed buffers


From: Dmitry Antipov
Subject: Re: Reachable killed buffers
Date: Tue, 11 Sep 2012 09:25:29 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120824 Thunderbird/15.0

On 09/11/2012 12:15 AM, Stefan Monnier wrote:

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

It's done in 109976.

Dead frame's buffer_list slot is another place to hold killed buffers for
a while (for live frames, killed buffers are filtered out by store_frame_param),
so the similar removal of killed buffers looks reasonable for dead frames too.

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.

IIUC both BLVs and frame/window buffer lists aren't shared. So, marking
traversal which sees an owner symbol/frame/window for the first time
sees these objects for the first time too (thus mark them correctly).
And even we change buffer list or BLV so the marked object becomes
unreachable, we just create some floating garbage which survives current
GC but will be reclaimed during the next one.

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

IIUC this comment is partially invalid since lisp.h comment says that
Lisp_Buffer_Local_Value can't be forwarded to buffer or kboard object
(and this is really so).

Dmitry

Attachment: discard_killed_buffers.patch
Description: Text document


reply via email to

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