diff options
| author | Paul Eggert | 2017-11-13 08:51:41 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-11-13 10:16:52 -0800 |
| commit | d14956099d0daf0faa132b20e0fb0d46cae001be (patch) | |
| tree | 6e495f1c4f9ea10377941679b0fb2f26c8283246 | |
| parent | b1573a97e17b518723ab3f906eb6d521caed196d (diff) | |
| download | emacs-d14956099d0daf0faa132b20e0fb0d46cae001be.tar.gz emacs-d14956099d0daf0faa132b20e0fb0d46cae001be.zip | |
Simplify by removing HAVE_STRUCT_ATTRIBUTE_ALIGNED
* configure.ac (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Remove. No longer
needed, since we no longer rely on __attribute__ ((aligned (8))).
All uses removed.
* src/emacs-module.c (HAVE_STRUCT_ATTRIBUTE_ALIGNED): Remove.
(lisp_to_value): Simplify now that we no longer need to worry
whether HAVE_STRUCT_ATTRIBUTE_ALIGNED is false.
| -rw-r--r-- | admin/CPP-DEFINES | 1 | ||||
| -rw-r--r-- | configure.ac | 16 | ||||
| -rw-r--r-- | src/emacs-module.c | 17 |
3 files changed, 0 insertions, 34 deletions
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 10b558d1ada..7a90b3dbe4f 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -103,7 +103,6 @@ HAVE_ALARM | |||
| 103 | HAVE_ALLOCA | 103 | HAVE_ALLOCA |
| 104 | HAVE_ALLOCA_H | 104 | HAVE_ALLOCA_H |
| 105 | HAVE_ALSA | 105 | HAVE_ALSA |
| 106 | HAVE_ATTRIBUTE_ALIGNED | ||
| 107 | HAVE_BDFFONT | 106 | HAVE_BDFFONT |
| 108 | HAVE_BOXES | 107 | HAVE_BOXES |
| 109 | HAVE_C99_STRTOLD | 108 | HAVE_C99_STRTOLD |
diff --git a/configure.ac b/configure.ac index 5579342c4e5..3c72f168a3d 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -5113,22 +5113,6 @@ else | |||
| 5113 | fi | 5113 | fi |
| 5114 | AC_SUBST(LIBXMENU) | 5114 | AC_SUBST(LIBXMENU) |
| 5115 | 5115 | ||
| 5116 | AC_CACHE_CHECK([for struct alignment], | ||
| 5117 | [emacs_cv_struct_alignment], | ||
| 5118 | [AC_COMPILE_IFELSE( | ||
| 5119 | [AC_LANG_PROGRAM([[#include <stddef.h> | ||
| 5120 | struct __attribute__ ((aligned (8))) s { char c; }; | ||
| 5121 | struct t { char c; struct s s; }; | ||
| 5122 | char verify[offsetof (struct t, s) == 8 ? 1 : -1]; | ||
| 5123 | ]])], | ||
| 5124 | [emacs_cv_struct_alignment=yes], | ||
| 5125 | [emacs_cv_struct_alignment=no])]) | ||
| 5126 | if test "$emacs_cv_struct_alignment" = yes; then | ||
| 5127 | AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], 1, | ||
| 5128 | [Define to 1 if 'struct __attribute__ ((aligned (N)))' aligns the | ||
| 5129 | structure to an N-byte boundary.]) | ||
| 5130 | fi | ||
| 5131 | |||
| 5132 | if test "${GNU_MALLOC}" = "yes" ; then | 5116 | if test "${GNU_MALLOC}" = "yes" ; then |
| 5133 | AC_DEFINE(GNU_MALLOC, 1, | 5117 | AC_DEFINE(GNU_MALLOC, 1, |
| 5134 | [Define to 1 if you want to use the GNU memory allocator.]) | 5118 | [Define to 1 if you want to use the GNU memory allocator.]) |
diff --git a/src/emacs-module.c b/src/emacs-module.c index 6bc91a7e06a..b351515c3bd 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -998,10 +998,6 @@ lisp_to_value_bits (Lisp_Object o) | |||
| 998 | return (emacs_value) p; | 998 | return (emacs_value) p; |
| 999 | } | 999 | } |
| 1000 | 1000 | ||
| 1001 | #ifndef HAVE_STRUCT_ATTRIBUTE_ALIGNED | ||
| 1002 | enum { HAVE_STRUCT_ATTRIBUTE_ALIGNED = 0 }; | ||
| 1003 | #endif | ||
| 1004 | |||
| 1005 | /* Convert O to an emacs_value. Allocate storage if needed; this can | 1001 | /* Convert O to an emacs_value. Allocate storage if needed; this can |
| 1006 | signal if memory is exhausted. Must be an injective function. */ | 1002 | signal if memory is exhausted. Must be an injective function. */ |
| 1007 | static emacs_value | 1003 | static emacs_value |
| @@ -1029,19 +1025,6 @@ lisp_to_value (emacs_env *env, Lisp_Object o) | |||
| 1029 | /* Package the incompressible object pointer inside a pair | 1025 | /* Package the incompressible object pointer inside a pair |
| 1030 | that is compressible. */ | 1026 | that is compressible. */ |
| 1031 | Lisp_Object pair = Fcons (o, ltv_mark); | 1027 | Lisp_Object pair = Fcons (o, ltv_mark); |
| 1032 | |||
| 1033 | if (! HAVE_STRUCT_ATTRIBUTE_ALIGNED) | ||
| 1034 | { | ||
| 1035 | /* Keep calling Fcons until it returns a compressible pair. | ||
| 1036 | This shouldn't take long. */ | ||
| 1037 | while ((intptr_t) XCONS (pair) & (GCALIGNMENT - 1)) | ||
| 1038 | pair = Fcons (o, pair); | ||
| 1039 | |||
| 1040 | /* Plant the mark. The garbage collector will eventually | ||
| 1041 | reclaim any just-allocated incompressible pairs. */ | ||
| 1042 | XSETCDR (pair, ltv_mark); | ||
| 1043 | } | ||
| 1044 | |||
| 1045 | v = (emacs_value) ((intptr_t) XCONS (pair) + Lisp_Cons); | 1028 | v = (emacs_value) ((intptr_t) XCONS (pair) + Lisp_Cons); |
| 1046 | } | 1029 | } |
| 1047 | 1030 | ||