diff options
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/thread.c b/src/thread.c index 9613d1435f7..3f9595274e9 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -643,12 +643,19 @@ do_nothing (Lisp_Object whatever) | |||
| 643 | static void * | 643 | static void * |
| 644 | run_thread (void *state) | 644 | run_thread (void *state) |
| 645 | { | 645 | { |
| 646 | char stack_pos; | 646 | /* Make sure stack_top and m_stack_bottom are properly aligned as GC |
| 647 | expects. */ | ||
| 648 | union | ||
| 649 | { | ||
| 650 | void *p; | ||
| 651 | char c; | ||
| 652 | } stack_pos; | ||
| 653 | |||
| 647 | struct thread_state *self = state; | 654 | struct thread_state *self = state; |
| 648 | struct thread_state **iter; | 655 | struct thread_state **iter; |
| 649 | 656 | ||
| 650 | self->m_stack_bottom = &stack_pos; | 657 | self->m_stack_bottom = &stack_pos.c; |
| 651 | self->stack_top = &stack_pos; | 658 | self->stack_top = &stack_pos.c; |
| 652 | self->thread_id = sys_thread_self (); | 659 | self->thread_id = sys_thread_self (); |
| 653 | 660 | ||
| 654 | acquire_global_lock (self); | 661 | acquire_global_lock (self); |