From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel 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 Message-ID: <5048B638.7070706@gmx.at> References: <504848D0.4020908@yandex.ru> <504850B4.7020002@gmx.at> <5048739E.80005@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346942518 17592 80.91.229.3 (6 Sep 2012 14:41:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2012 14:41:58 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 06 16:42:00 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T9dHL-0005WJ-3H for ged-emacs-devel@m.gmane.org; Thu, 06 Sep 2012 16:41:59 +0200 Original-Received: from localhost ([::1]:56378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9dHI-0005ep-1I for ged-emacs-devel@m.gmane.org; Thu, 06 Sep 2012 10:41:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9dHA-0005UJ-NG for emacs-devel@gnu.org; Thu, 06 Sep 2012 10:41:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9dH2-0000l0-Uo for emacs-devel@gnu.org; Thu, 06 Sep 2012 10:41:48 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:43525) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1T9dH2-0000kd-LX for emacs-devel@gnu.org; Thu, 06 Sep 2012 10:41:40 -0400 Original-Received: (qmail invoked by alias); 06 Sep 2012 14:41:35 -0000 Original-Received: from 62-47-57-144.adsl.highway.telekom.at (EHLO [62.47.57.144]) [62.47.57.144] by mail.gmx.net (mp030) with SMTP; 06 Sep 2012 16:41:35 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19ObdMWyq9OPSneBJT2bH95CB7T9xgbkGVfpUCqJL tBBvWr6lOamlLO In-Reply-To: <5048739E.80005@yandex.ru> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153110 Archived-At: >> > 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