From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r117897: Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.
Date: Wed, 17 Sep 2014 22:43:22 -0400 [thread overview]
Message-ID: <jwv1tr9ejjn.fsf-monnier+emacsdiffs@gnu.org> (raw)
In-Reply-To: <E1XUQ8O-0008RX-K8@vcs.savannah.gnu.org> (Paul Eggert's message of "Thu, 18 Sep 2014 01:03:44 +0000")
> +/* Alignment fixup needed for alloca. GCC aligns alloca properly already,
> + Clang sometimes doesn't, and play it safe for other random compilers. */
> +# if __GNUC__ && !__clang__
> +enum { ALLOCA_FIXUP = 0 };
> +# else
> +enum { ALLOCA_FIXUP = GCALIGNMENT - 1 };
> +# endif
> +
> +/* Declare a void * variable PTR and set it to a properly-aligned array of
> + N newly allocated bytes with function lifetime. */
> +# define LOCAL_ALLOCA(ptr, n) \
> + void *ptr = alloca ((n) + ALLOCA_FIXUP); \
> + ptr = (void *) ((intptr_t) ptr_ & ~(ALLOCA_FIXUP))
I find this hideous. I'd prefer we just don't use alloca in
those cases where alignment would be a problem.
Stefan
next parent reply other threads:[~2014-09-18 2:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1XUQ8O-0008RX-K8@vcs.savannah.gnu.org>
2014-09-18 2:43 ` Stefan Monnier [this message]
2014-09-18 5:42 ` [Emacs-diffs] trunk r117897: Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64 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
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=jwv1tr9ejjn.fsf-monnier+emacsdiffs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eggert@cs.ucla.edu \
--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).