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