unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] trunk r117897: Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.
       [not found] <E1XUQ8O-0008RX-K8@vcs.savannah.gnu.org>
@ 2014-09-18  2:43 ` Stefan Monnier
  2014-09-18  5:42   ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2014-09-18  2:43 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> +/* 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Emacs-diffs] trunk r117897: Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64.
  2014-09-18  2:43 ` [Emacs-diffs] trunk r117897: Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64 Stefan Monnier
@ 2014-09-18  5:42   ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2014-09-18  5:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier wrote:
> I'd prefer we just don't use alloca in
> those cases where alignment would be a problem.

It's certainly simpler that way.  I changed lisp.h to do that in trunk 
bzr 117898.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-18  5:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1XUQ8O-0008RX-K8@vcs.savannah.gnu.org>
2014-09-18  2:43 ` [Emacs-diffs] trunk r117897: Port USE_LOCAL_ALLOCATORS code to clang 3.4 x86-64 Stefan Monnier
2014-09-18  5:42   ` Paul Eggert

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).