From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Reachable killed buffers Date: Mon, 10 Sep 2012 16:15:11 -0400 Message-ID: References: <504848D0.4020908@yandex.ru> <5048D826.3040103@yandex.ru> <5049C400.8070400@gmx.at> <504DB6DD.9030002@yandex.ru> <504E042E.5040100@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1347308124 8222 80.91.229.3 (10 Sep 2012 20:15:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2012 20:15:24 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 10 22:15:26 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 1TBAOD-0006lm-KW for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2012 22:15:25 +0200 Original-Received: from localhost ([::1]:44113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBAOA-0001wS-1z for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2012 16:15:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBAO7-0001wM-6N for emacs-devel@gnu.org; Mon, 10 Sep 2012 16:15:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBAO6-0004DS-6B for emacs-devel@gnu.org; Mon, 10 Sep 2012 16:15:19 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBAO5-0004Bt-Po for emacs-devel@gnu.org; Mon, 10 Sep 2012 16:15:18 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q8AKFBqe020777; Mon, 10 Sep 2012 16:15:11 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A48FEB4085; Mon, 10 Sep 2012 16:15:11 -0400 (EDT) In-Reply-To: <504E042E.5040100@yandex.ru> (Dmitry Antipov's message of "Mon, 10 Sep 2012 19:15:58 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 132.204.246.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:153223 Archived-At: > 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