From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: Finding objects on C stack - alternate GCPRO Date: Thu, 17 Nov 2011 13:50:11 +0100 Message-ID: <87ehx6q5fg.fsf@escher.home> References: <4EC38B72.1000101@yandex.ru> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321534254 5647 80.91.229.12 (17 Nov 2011 12:50:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2011 12:50:54 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 17 13:50:46 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RR1QQ-0003VQ-GW for ged-emacs-devel@m.gmane.org; Thu, 17 Nov 2011 13:50:42 +0100 Original-Received: from localhost ([::1]:35852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RR1QP-0005pb-GP for ged-emacs-devel@m.gmane.org; Thu, 17 Nov 2011 07:50:41 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RR1QH-0005p5-Ca for emacs-devel@gnu.org; Thu, 17 Nov 2011 07:50:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RR1QB-0006jB-GV for emacs-devel@gnu.org; Thu, 17 Nov 2011 07:50:33 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:41800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RR1QB-0006j7-A1 for emacs-devel@gnu.org; Thu, 17 Nov 2011 07:50:27 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RR1QA-0003Mf-Hu for emacs-devel@gnu.org; Thu, 17 Nov 2011 13:50:26 +0100 Original-Received: from i59f56821.versanet.de ([89.245.104.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Nov 2011 13:50:26 +0100 Original-Received: from stephen.berman by i59f56821.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Nov 2011 13:50:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: i59f56821.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:146075 Archived-At: On Wed, 16 Nov 2011 06:06:14 -0500 Eli Zaretskii wrote: > Given that most platforms make GCPRO and UNGCPRO a no-op (and the only > 2 platforms that don't are probably simply not maintained enough and > don't use GCC anyway), why is this important enough to waste energy on > it? On Wed, 16 Nov 2011 09:41:36 -0500 Stefan Monnier wrote: > The problem is that the few platforms that don't use GCC are the ones > that require GCPROs as well, so not only it would be a large change, but > it would also require us dropping support for those non-gcc > non-conservative-GC platforms. In light of these two statements it seems like the Elisp manual (section Writing Emacs Primitives) gives too much weight to GCPRO, e.g. where it says: It suffices to ensure that at least one pointer to each object is GC-protected; that way, the object cannot be recycled, so all pointers to it remain valid. Thus, a particular local variable can do without protection if it is certain that the object it points to will be preserved by some other pointer (such as another local variable which has a `GCPRO')(1). Otherwise, the local variable needs a `GCPRO'. If this is only needed on platforms that don't support gcc, shouldn't the manual say that, or should GCPRO be mentioned at all? Perhaps I'm completely missing the point, since the only thing I know about GCPRO is what's in the manual; if so, could someone elaborate on the role of GCPRO, or if that's inappropriate here, point me to relevant places (preferable comments) in the Emacs sources or relevant external discussion? Thanks. Steve Berman