From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: How and when to use GCPRO? Date: Mon, 27 Dec 2010 19:37:17 -0800 Message-ID: <4D195B6D.2060305@gmail.com> References: <4D193E60.8070108@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD9B776E813720DA032E48934" X-Trace: dough.gmane.org 1293507461 13937 80.91.229.12 (28 Dec 2010 03:37:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Dec 2010 03:37:41 +0000 (UTC) Cc: Andreas Schwab , Leo , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 28 04:37:36 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 1PXQNP-0003UN-MI for ged-emacs-devel@m.gmane.org; Tue, 28 Dec 2010 04:37:34 +0100 Original-Received: from localhost ([127.0.0.1]:48866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXQNO-0008O6-9k for ged-emacs-devel@m.gmane.org; Mon, 27 Dec 2010 22:37:30 -0500 Original-Received: from [140.186.70.92] (port=37414 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXQNK-0008Nr-9W for emacs-devel@gnu.org; Mon, 27 Dec 2010 22:37:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXQNJ-00068t-91 for emacs-devel@gnu.org; Mon, 27 Dec 2010 22:37:26 -0500 Original-Received: from mail-yi0-f41.google.com ([209.85.218.41]:33351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXQNJ-00068o-4r for emacs-devel@gnu.org; Mon, 27 Dec 2010 22:37:25 -0500 Original-Received: by yia25 with SMTP id 25so1881822yia.0 for ; Mon, 27 Dec 2010 19:37:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=koPfmSwsIx27hg0aJQAGlLHhX9weE0TyoY7JXE69jps=; b=ntPIW+Kd0IhsUNh6l8+W+atNsDMknrR8vwO1nAUr5lZpiDRuMjLpZZpm55+1Qw1QUy rGDXnEX057/JvffpiMIZ6Mx22tcefI5PUNEqkjExZObVQQz/+CrIdsc4605PLox1Clhd FbWA592E24KBtgAjaeV6PUcm6yCmRzZqtnxfY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=gR5vzkg5XdQN5XODXo2kg30NKy0yZsoFATWhTqt2amvVuX/DK6DSR1h63opBJEFtjk e5eOX4FWN0aWBEFeYNvKtTwVlZpI9yZoBbwwobOzzobPYCGkf3A9fiJPATpX38VmVgAA XNAKSFLpWTjfzuA31yVeE83yoCEK9jAb/oMbQ= Original-Received: by 10.91.8.20 with SMTP id l20mr3850140agi.147.1293507444600; Mon, 27 Dec 2010 19:37:24 -0800 (PST) Original-Received: from edith.local (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id c7sm18459622ana.17.2010.12.27.19.37.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Dec 2010 19:37:23 -0800 (PST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: X-Enigmail-Version: 1.1.1 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:133997 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD9B776E813720DA032E48934 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/27/10 6:17 PM, Stefan Monnier wrote: >>>>> Actually, both Fcar and Fcdr can GC (by signalling an error which >>>>> triggers the debugger). >>>> But the debugger will not return. >>> Oh, right, >> Discussions like this worry me. What if the function is later changed = to >> call something that can GC? What if it's used in some new context? If >> it's not utterly performance-critical code, isn't it better to be safe= >> than sorry and GCPRO anyway? It's not as if it's an expensive operatio= n. >> Premature optimization is the root of all evil, after all. >=20 > On most platforms, GCPRO is a no-op, and on those where it's not, it's > never been a major performance issue, AFAIK. The problem is just that > it makes the code that much more verbose and painful to > write/read/maintain. Hrm. You learn something every day --- I thought Emacs was doing precise GC the way it has since time immemorial. How much of a win was the GC_MARK_STACK conservative scanning approach? --------------enigD9B776E813720DA032E48934 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk0ZW3EACgkQ17c2LVA10VuK6gCfWitCTI0Ju8l5gA1wWq74zxQf zGwAoJAsF+PZCfeybjd6Uu5op+0jJSAU =gvRb -----END PGP SIGNATURE----- --------------enigD9B776E813720DA032E48934--