[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding objects on C stack - alternate GCPRO

From: Stephen Berman
Subject: Re: Finding objects on C stack - alternate GCPRO
Date: Thu, 17 Nov 2011 13:50:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

On Wed, 16 Nov 2011 06:06:14 -0500 Eli Zaretskii <address@hidden> 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 <address@hidden> 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

      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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]