emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109890: Do not mark objects from


From: martin rudalics
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r109890: Do not mark objects from deleted buffers, windows and frames.
Date: Thu, 06 Sep 2012 16:42:00 +0200

>>  > Hm. For example, killed buffers may sit in all_buffers for a while,
>> and
>>  > still
>>  > have from tens to thousands reachable objects per buffer (although
>> I didn't
>>  > check whether these objects are reachable only from this dead buffer).
>>
>> Could you elaborate?
>
> Elaborate what?

Stefan answered that for me.

>> Marker objects belong to the buffer.
>
> Not all

Unless they point nowhere.  Or what do you mean here?

> - make_window attaches two new markers to W->start and
> W->pointm; when W
> is set up to display the buffer B (set_window_buffer or maybe somewhere
> else),
> these markers are changed from 'point to nowhere' to 'point into B'.

Hence they belong to buffer B now.

>> The start and pointm fields are
>> regenerated from the saved window structure.
>
> Their member values are regenerated assuming that W->start and W->pointm
> itself
> are valid marker objects:
> Fset_window_configuration:
> ...
> else if (!NILP (BVAR (XBUFFER (p->buffer), name)))
>   /* If saved buffer is alive, install it.  */
>   {
>     wset_buffer (w, p->buffer);
>     w->start_at_line_beg = !NILP (p->start_at_line_beg);
>     set_marker_restricted (w->start, p->start, w->buffer);  /* here */
>     set_marker_restricted (w->pointm, p->pointm,            /* and here */
>                            w->buffer);
>     Fset_marker (BVAR (XBUFFER (w->buffer), mark),
>                  p->mark, w->buffer);
>
> This will throw an error if start/pointm aren't markers, or crash
> if they're invalid or uninitialized; if we can't trust the values
> stored in W's fields, we should use Fcopy_marker instead.

I miss you.  Do you mean that

(let ((window (split-window)))
  (set-window-buffer window (get-buffer-create "*foo*"))
  (sit-for 1)
  (save-window-excursion
    (delete-window window)
    (kill-buffer "*foo*")
    (sit-for 1)))

should crash?

martin



reply via email to

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