diff options
| author | Paul Eggert | 2011-10-06 01:06:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-10-06 01:06:24 -0700 |
| commit | c9af454e51a926245a3ee19c04ae5ed058fcd215 (patch) | |
| tree | 4a2418ea383386a197183b1af930c74d9f812e45 /src/alloc.c | |
| parent | 8d1da888c6f3c6763c7e6e73a5bdd3bf997d0cfc (diff) | |
| download | emacs-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/alloc.c')
| -rw-r--r-- | src/alloc.c | 12 |
1 files changed, 3 insertions, 9 deletions
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 | ||
| 4463 | static void | 4460 | static void |
| 4464 | mark_stack (void) | 4461 | mark_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); |