* 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.
+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,
/* 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 */
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)
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)
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);