From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature.
Date: Tue, 30 Sep 2014 13:55:09 -0400 [thread overview]
Message-ID: <jwv8ul1knak.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1XYzSf-00075J-Dr@vcs.savannah.gnu.org> (Dmitry Antipov's message of "Tue, 30 Sep 2014 15:35:33 +0000")
> + 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
next parent reply other threads:[~2014-09-30 17:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1XYzSf-00075J-Dr@vcs.savannah.gnu.org>
2014-09-30 17:55 ` Stefan Monnier [this message]
2014-09-30 19:15 ` [Emacs-diffs] trunk r117987: * internals.texi (Stack-allocated Objects): Describe this feature Paul Eggert
2014-09-30 19:29 ` Eli Zaretskii
2014-09-30 19:49 ` David Kastrup
2014-09-30 20:20 ` Stefan Monnier
2014-10-01 3:31 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8ul1knak.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=dmantipov@yandex.ru \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.