From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: please help concerning specpdl Date: Tue, 14 Dec 2010 19:53:20 -0500 Message-ID: References: <35942.130.55.118.19.1291652550.squirrel@webmail.lanl.gov> <60550.130.55.118.19.1292372090.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1292374418 14000 80.91.229.12 (15 Dec 2010 00:53:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 00:53:38 +0000 (UTC) Cc: Alin Soare , Emacs Dev To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 15 01:53:33 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 1PSfcb-0000hp-2n for ged-emacs-devel@m.gmane.org; Wed, 15 Dec 2010 01:53:33 +0100 Original-Received: from localhost ([127.0.0.1]:59884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSfca-0000Y4-HZ for ged-emacs-devel@m.gmane.org; Tue, 14 Dec 2010 19:53:32 -0500 Original-Received: from [140.186.70.92] (port=57833 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSfcT-0000Sq-Jy for emacs-devel@gnu.org; Tue, 14 Dec 2010 19:53:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSfcS-0004sN-DG for emacs-devel@gnu.org; Tue, 14 Dec 2010 19:53:25 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:57199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSfcS-0004s7-AT for emacs-devel@gnu.org; Tue, 14 Dec 2010 19:53:24 -0500 Original-Received: by vws10 with SMTP id 10so576156vws.0 for ; Tue, 14 Dec 2010 16:53:23 -0800 (PST) Original-Received: by 10.220.198.139 with SMTP id eo11mr1761633vcb.95.1292374402808; Tue, 14 Dec 2010 16:53:22 -0800 (PST) Original-Received: from [10.0.0.158] (c-24-128-190-224.hsd1.ma.comcast.net [24.128.190.224]) by mx.google.com with ESMTPS id e18sm200181vcf.36.2010.12.14.16.53.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 16:53:22 -0800 (PST) X-Priority: 3 (Normal) In-Reply-To: <60550.130.55.118.19.1292372090.squirrel@webmail.lanl.gov> X-Mailer: Apple Mail (2.1082) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:133704 Archived-At: On Dec 14, 2010, at 19:14, Davis Herring wrote: >> 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 ? >=20 > I believe the GCPRO draws the attention of the stack checker to those = Lisp > objects to make sure that they're not collected. The Lisp engine and the garbage collection code have undergone some = revision over the years, and support a few different configurations = based on the machine architecture and operating system support. See, = for example, the comment discussing GC_MARK_STACK in lisp.h. GCPRO = macros are used to keep track of Lisp_Object variables on the C stack in = case conservative stack scanning is not used. If conservative stack = scanning is used, you can make GCPRO macros be no-ops, or you can = instrument them to compare the effectiveness of the two techniques. But in terms of writing C code, you should assume that the GCPRO = machinery is required. (Well, that's not 100% true. If any code path that can result in the = garbage collector being called either doesn't care about a particular = object any more, or can guarantee that the object will be visible to the = garbage collector through some other path, then it needn't be recorded = with GCPRO. But it's probably better to be conservative if you're not = completely certain.) Ken=