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: [Emacs-diffs] master 9d8d065: Add support for finalizers Date: Tue, 03 Mar 2015 13:18:10 -0500 Message-ID: References: <20150302233934.18904.59563@vcs.savannah.gnu.org> <54F5EAA6.8030403@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1425406722 29136 80.91.229.3 (3 Mar 2015 18:18:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2015 18:18:42 +0000 (UTC) Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 03 19:18:36 2015 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 1YSrOt-0005JG-Br for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2015 19:18:35 +0100 Original-Received: from localhost ([::1]:40279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSrOs-0007X7-EY for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2015 13:18:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSrOd-0007VN-Qu for emacs-devel@gnu.org; Tue, 03 Mar 2015 13:18:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSrOZ-0003jd-OZ for emacs-devel@gnu.org; Tue, 03 Mar 2015 13:18:19 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:59620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSrOZ-0003jN-JC for emacs-devel@gnu.org; Tue, 03 Mar 2015 13:18:15 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t23IIAVh020516; Tue, 3 Mar 2015 13:18:11 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 2B47FAE187; Tue, 3 Mar 2015 13:18:10 -0500 (EST) In-Reply-To: <54F5EAA6.8030403@dancol.org> (Daniel Colascione's message of "Tue, 03 Mar 2015 09:08:54 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5234=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5234> : inlines <2342> : streams <1399376> : uri <1870113> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:183611 Archived-At: >> Question: why use a doubly-linked list, unlike pretty much everything >> else in our code base? > We remove finalizers from the middle of the list in unchain_finalizer. > We could just rebuild the list as we scan it, but when we'd have to > touch every node. Or we could maintain auxiliary state, but then in > run_finalizers we'd have to scan the whole list instead of the part > we're running. You can remove them from the middle of the list with a singly-linked list as well, by keeping a "double-indirection" pointer. That's what we do for markers. It's not ideal, but it's no worse than using doubly-linked lists. >>> + DEFVAR_BOOL ("gc-precise-p", gc_precise_p, >> This name is wrong. "-p" stands for "predicate" and a predicate is >> a function that returns a boolean, whereas this is a variable/constant. > I've also seen it for boolean-valued variables. Oh, yes, you're not the only one introducing such horrors, but we should still avoid making things worse in this respect. Stefan