From: Paul Eggert <eggert@cs.ucla.edu>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: [RFC] Omit all GCPRO stuff if GC_MAKE_GCPROS_NOOPS
Date: Sun, 15 Jul 2012 23:41:05 -0700 [thread overview]
Message-ID: <5003B781.7080006@cs.ucla.edu> (raw)
In-Reply-To: <5002FF32.2090308@yandex.ru>
Could you please explain the point of the patch?
Is it to simplify debugging, or improve performance, or what?
I don't see the advantage over the current approach.
> +#define DEFGCPRO1 void *__dummy ATTRIBUTE_UNUSED = &__dummy
This would be cleaner if DEFGCPRO1 etc were either empty,
or expanded to something that ended in ";". Then the caller
can just do "DEFGCPRO1" (without the semicolon) and there's
no need for dummy declarations.
> +#define IF_GCPRO(code) do { } while (0)
...
> +#define IF_GCPRO(code) do { code; } while (0)
IF_GCPRO should act more like a function, i.e., its argument
should be an expression and it should expand to an expression.
This is more consistent with how typical macro-like functions work.
The above should be:
#define IF_GCPRO(expr) ((void) 0)
...
#define IF_GCPRO(expr) (expr, (void) 0)
and calls like this:
IF_GCPRO (gcpro3.nvars = nargs; gcpro4.nvars = nargs);
should be replaced by:
IF_GCPRO ((gcpro3.nvars = nargs, gcpro4.nvars = nargs));
next prev parent reply other threads:[~2012-07-16 6:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-15 17:34 [RFC] Omit all GCPRO stuff if GC_MAKE_GCPROS_NOOPS Dmitry Antipov
2012-07-16 6:41 ` Paul Eggert [this message]
2012-07-16 12:42 ` Michael Welsh Duggan
2012-07-16 13:39 ` Jan Djärv
2012-07-16 14:14 ` Paul Eggert
2012-07-17 7:20 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5003B781.7080006@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).