aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-10-06 01:06:24 -0700
committerPaul Eggert2011-10-06 01:06:24 -0700
commitc9af454e51a926245a3ee19c04ae5ed058fcd215 (patch)
tree4a2418ea383386a197183b1af930c74d9f812e45 /src
parent8d1da888c6f3c6763c7e6e73a5bdd3bf997d0cfc (diff)
downloademacs-c9af454e51a926245a3ee19c04ae5ed058fcd215.tar.gz
emacs-c9af454e51a926245a3ee19c04ae5ed058fcd215.zip
[ChangeLog]
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/alloc.c12
2 files changed, 6 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3432652dbe5..c3e03c211f5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -14,6 +14,9 @@
14 Use int, not EMACS_INT, where int is wide enough. 14 Use int, not EMACS_INT, where int is wide enough.
15 (inhibit_garbage_collection, Fgarbage_collect): 15 (inhibit_garbage_collection, Fgarbage_collect):
16 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts. 16 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
17 (GC_LISP_OBJECT_ARGUMENT):
18 Use offsetof, not __alignof__ or sizeof. __alignof__ gives
19 the wrong answer on the x86 with GCC.
17 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where 20 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
18 int might not be wide enough. 21 int might not be wide enough.
19 (bidi_cache_search, bidi_cache_find, bidi_init_it) 22 (bidi_cache_search, bidi_cache_find, bidi_init_it)
diff --git a/src/alloc.c b/src/alloc.c
index bfb40e6c09a..100a5e593fa 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4455,10 +4455,7 @@ dump_zombies (void)
4455 pass starting at the start of the stack + 2. Likewise, if the 4455 pass starting at the start of the stack + 2. Likewise, if the
4456 minimal alignment of Lisp_Objects on the stack is 1, four passes 4456 minimal alignment of Lisp_Objects on the stack is 1, four passes
4457 would be necessary, each one starting with one byte more offset 4457 would be necessary, each one starting with one byte more offset
4458 from the stack start. 4458 from the stack start. */
4459
4460 The current code assumes by default that Lisp_Objects are aligned
4461 equally on the stack. */
4462 4459
4463static void 4460static void
4464mark_stack (void) 4461mark_stack (void)
@@ -4522,11 +4519,8 @@ mark_stack (void)
4522 that's not the case, something has to be done here to iterate 4519 that's not the case, something has to be done here to iterate
4523 over the stack segments. */ 4520 over the stack segments. */
4524#ifndef GC_LISP_OBJECT_ALIGNMENT 4521#ifndef GC_LISP_OBJECT_ALIGNMENT
4525#ifdef __GNUC__ 4522# define GC_LISP_OBJECT_ALIGNMENT \
4526#define GC_LISP_OBJECT_ALIGNMENT __alignof__ (Lisp_Object) 4523 offsetof (struct {char a; Lisp_Object b;}, b)
4527#else
4528#define GC_LISP_OBJECT_ALIGNMENT sizeof (Lisp_Object)
4529#endif
4530#endif 4524#endif
4531 for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT) 4525 for (i = 0; i < sizeof (Lisp_Object); i += GC_LISP_OBJECT_ALIGNMENT)
4532 mark_memory (stack_base, end, i); 4526 mark_memory (stack_base, end, i);