emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objec


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature.
Date: Tue, 30 Sep 2014 13:55:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> +  In C, this is implemented as a special macros which expands to
> +a @code{Lisp_Object} with block-scoped semantics and lifetime (see
> +the code around @code{USE_STACK_LISP_OBJECTS} in @file{lisp.h}).  This
> +means that these objects are not managed by the garbage collector;
> +instead, they are allocated like local variables in C and automatically
> +freed when an execution reaches an end of the corresponding scope.  Thus,
> +allocation and freeing are faster than using garbage collector.  But
> +remember that passing them out of their scope results in undefined
> +behavior.  Think twice before using this feature and carefully debug
> +your code with @code{GC_CHECK_MARKED_OBJECTS} (see @file{alloc.c}).

I'm an old-style programmer, so I don't know C99 and I hence don't know
what is the "corresponding scope" of those new thingies.
See my other message about these macros.  I'd much prefer
declaration-level macros, which would come with clear scoping.


        Stefan



reply via email to

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