From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: please help concerning specpdl Date: Tue, 14 Dec 2010 16:14:50 -0800 (PST) Message-ID: <60550.130.55.118.19.1292372090.squirrel@webmail.lanl.gov> References: <35942.130.55.118.19.1291652550.squirrel@webmail.lanl.gov> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1292372112 5060 80.91.229.12 (15 Dec 2010 00:15:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 00:15:12 +0000 (UTC) Cc: Emacs Dev To: "Alin Soare" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 15 01:15:02 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PSf1K-0001aC-6u for ged-emacs-devel@m.gmane.org; Wed, 15 Dec 2010 01:15:02 +0100 Original-Received: from localhost ([127.0.0.1]:34044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSf1J-0001Kd-H8 for ged-emacs-devel@m.gmane.org; Tue, 14 Dec 2010 19:15:01 -0500 Original-Received: from [140.186.70.92] (port=44411 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSf1E-0001KU-4o for emacs-devel@gnu.org; Tue, 14 Dec 2010 19:14:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSf1C-0007Qw-Vj for emacs-devel@gnu.org; Tue, 14 Dec 2010 19:14:56 -0500 Original-Received: from proofpoint1.lanl.gov ([204.121.3.25]:38678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSf1C-0007QL-LA for emacs-devel@gnu.org; Tue, 14 Dec 2010 19:14:54 -0500 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint1 (8.14.3/8.14.3) with ESMTP id oBF0Eokc003836; Tue, 14 Dec 2010 17:14:50 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 5761C151F7E; Tue, 14 Dec 2010 17:14:50 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (Postfix) with ESMTP id 442EC151F7D; Tue, 14 Dec 2010 17:14:50 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 425851CA81E1; Tue, 14 Dec 2010 17:14:50 -0700 (MST) Original-Received: from 130.55.118.19 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Tue, 14 Dec 2010 16:14:50 -0800 (PST) In-Reply-To: User-Agent: SquirrelMail/1.4.8-5.el5_4.10.lanl3 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2010-12-14_14:2010-12-14, 2010-12-14, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133703 Archived-At: > Why let-binding-variables are memorized exactly here and not elsewhere ? Flet memorizes their old values on the stack; when it returns (or otherwise is exited), the old values are copied back, so they can't be needed beyond the lifetime of that stack frame. > why the do-while is good in this case, and not simply brackets? So that the whole thing is one statement that needs a ;, just like a normal function call. If it were brackets, you couldn't do if(x) SAFE_ALLOCA(...); else y=x; > I see that inside unbind_to, the symbols are unbounded 1 by one. Why the > specpdl_ptr is not decremented directly with count ? Because you need to do something with each record: restore old values for symbols, call functions registered with record_unwind_protect(), etc. > Probably because unbind_to is called from lisp code by (throw 'symbol > value), and specpdl_ptr must decrement 1 by 1 until the 'symbol is dound > on the stack ? catch-tags are searched separately: see struct catchtag. > Apart from (throw ... ), is which other situation unbind_to is called ? The other important one is Fsignal (quit and other errors). > I see that GCPROx macros are used to protect the variables of type Lisp > Object on the stack of C code (that the compiler creates), not to protect > the lisp objects in specpdl. The GCPRO protection is against the algorthm > of conservative stack. Am I right ? I believe the GCPRO draws the attention of the stack checker to those Lisp objects to make sure that they're not collected. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.