From 7cae64b4eed192a49ea258089639ec44da6095e2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Jan 2011 20:54:23 -0800 Subject: Improve performance on non-GCC hosts with __aligned__. --- src/ChangeLog | 8 ++++++++ src/config.in | 3 +++ src/lisp.h | 8 +++++--- 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f91ec458464..6e950569fbc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2011-01-18 Paul Eggert + + * lisp.h (DECL_ALIGN): Define if HAVE_ATTRIBUTE_ALIGNED, not if + defined __GNUC__. ../configure now checks for this GCC feature, + which is now also supported by IBM and Oracle compilers. + (USE_LSB_TAG) [defined DECL_ALIGN]: Also define if defined __sun, + since Solaris malloc returns mult-of-8. + 2011-01-18 Stefan Monnier * image.c (syms_of_image): Don't access XSYMBOL's internals directly. diff --git a/src/config.in b/src/config.in index d8a9722d316..62e83eea334 100644 --- a/src/config.in +++ b/src/config.in @@ -115,6 +115,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if ALSA is available. */ #undef HAVE_ALSA +/* Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works. */ +#undef HAVE_ATTRIBUTE_ALIGNED + /* Define to 1 if strtold conforms to C99. */ #undef HAVE_C99_STRTOLD diff --git a/src/lisp.h b/src/lisp.h index d00dbdc5def..5424bf7b83d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -122,16 +122,18 @@ extern void die (const char *, const char *, int) NO_RETURN; TYPEBITS-aligned. */ #ifndef NO_DECL_ALIGN # ifndef DECL_ALIGN -/* What compiler directive should we use for non-gcc compilers? -stef */ -# if defined (__GNUC__) +# if HAVE_ATTRIBUTE_ALIGNED # define DECL_ALIGN(type, var) \ type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var +# else + /* What directives do other compilers use? */ # endif # endif #endif /* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */ -#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined DARWIN_OS +#if (defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ \ + || defined DARWIN_OS || defined __sun) /* We also need to be able to specify mult-of-8 alignment on static vars. */ # if defined DECL_ALIGN # define USE_LSB_TAG -- cgit v1.2.1