diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2011-01-17 20:54:23 -0800 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-01-17 20:54:23 -0800 |
| commit | 7cae64b4eed192a49ea258089639ec44da6095e2 (patch) | |
| tree | b985de2a995674ad01ead7920526e80b9b4798b6 /src | |
| parent | 9cc3a0c79c5a6af2691b2b566f8e3eb3654b806f (diff) | |
Improve performance on non-GCC hosts with __aligned__.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/config.in | 3 | ||||
| -rw-r--r-- | src/lisp.h | 8 |
3 files changed, 16 insertions, 3 deletions
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 <eggert@cs.ucla.edu> + + * 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 <monnier@iro.umontreal.ca> * 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 <http://www.gnu.org/licenses/>. */ /* 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 |
