[ChangeLog]
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Oct 2011 08:06:24 +0000 (01:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Oct 2011 08:06:24 +0000 (01:06 -0700)
* configure.in (GC_LISP_OBJECT_ALIGNMENT): Remove.
This is now done by src/alloc.c.
[src/ChangeLog]
* alloc.c: (GC_LISP_OBJECT_ARGUMENT):
Use offsetof, not __alignof__ or sizeof.  __alignof__ gives
the wrong answer on the x86 with GCC.

ChangeLog
configure.in
src/ChangeLog
src/alloc.c

index 3e76c91..3d0286e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * configure.in (GC_LISP_OBJECT_ALIGNMENT): Remove.
+       This is now done by src/alloc.c.
+
 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
 
        * .bzrignore: Add ./GNUmakefile.unix, lib/SYS, lib/alloca.in-h,
index d2ffdd5..d5d34d5 100644 (file)
@@ -3663,9 +3663,6 @@ AH_BOTTOM([
   /* GC_SETJMP_WORKS is nearly always appropriate for GCC.  */
 #    define GC_SETJMP_WORKS 1
 #  endif
-#  ifndef GC_LISP_OBJECT_ALIGNMENT
-#    define GC_LISP_OBJECT_ALIGNMENT (__alignof__ (Lisp_Object))
-#  endif
 #endif
 
 #endif /* EMACS_CONFIG_H */
index 3432652..c3e03c2 100644 (file)
@@ -14,6 +14,9 @@
        Use int, not EMACS_INT, where int is wide enough.
        (inhibit_garbage_collection, Fgarbage_collect):
        Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
+       (GC_LISP_OBJECT_ARGUMENT):
+       Use offsetof, not __alignof__ or sizeof.  __alignof__ gives
+       the wrong answer on the x86 with GCC.
        * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
        int might not be wide enough.
        (bidi_cache_search, bidi_cache_find, bidi_init_it)
index bfb40e6..100a5e5 100644 (file)
@@ -4455,10 +4455,7 @@ dump_zombies (void)
    pass starting at the start of the stack + 2.  Likewise, if the
    minimal alignment of Lisp_Objects on the stack is 1, four passes
    would be necessary, each one starting with one byte more offset
-   from the stack start.
-
-   The current code assumes by default that Lisp_Objects are aligned
-   equally on the stack.  */
+   from the stack start.  */
 
 static void
 mark_stack (void)
@@ -4522,11 +4519,8 @@ mark_stack (void)
      that's not the case, something has to be done here to iterate
      over the stack segments.  */
 #ifndef GC_LISP_OBJECT_ALIGNMENT
-#ifdef __GNUC__
-#define GC_LISP_OBJECT_ALIGNMENT __alignof__ (Lisp_Object)
-#else
-#define GC_LISP_OBJECT_ALIGNMENT sizeof (Lisp_Object)
-#endif
+# define GC_LISP_OBJECT_ALIGNMENT \
+    offsetof (struct {char a; Lisp_Object b;}, b)
 #endif
   for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT)
     mark_memory (stack_base, end, i);