aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2016-12-23 18:28:44 -0800
committerPaul Eggert2016-12-23 18:29:13 -0800
commite2767bd010d5c30df97789b8b56a42eff4234e5b (patch)
tree342bd4317719b9f336a31a94f218f4cfb0d6f1a6 /src
parenteff901b8a39f42ddedf4c1db833b9071cae5962f (diff)
downloademacs-e2767bd010d5c30df97789b8b56a42eff4234e5b.tar.gz
emacs-e2767bd010d5c30df97789b8b56a42eff4234e5b.zip
Use max_align_t instead of void *
* src/thread.c (run_thread): Don’t assume void * is aligned enough.
Diffstat (limited to 'src')
-rw-r--r--src/thread.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/thread.c b/src/thread.c
index 3f9595274e9..0bb0b7e006a 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -645,17 +645,12 @@ run_thread (void *state)
645{ 645{
646 /* Make sure stack_top and m_stack_bottom are properly aligned as GC 646 /* Make sure stack_top and m_stack_bottom are properly aligned as GC
647 expects. */ 647 expects. */
648 union 648 max_align_t stack_pos;
649 {
650 void *p;
651 char c;
652 } stack_pos;
653 649
654 struct thread_state *self = state; 650 struct thread_state *self = state;
655 struct thread_state **iter; 651 struct thread_state **iter;
656 652
657 self->m_stack_bottom = &stack_pos.c; 653 self->m_stack_bottom = self->stack_top = (char *) &stack_pos;
658 self->stack_top = &stack_pos.c;
659 self->thread_id = sys_thread_self (); 654 self->thread_id = sys_thread_self ();
660 655
661 acquire_global_lock (self); 656 acquire_global_lock (self);