Commit c6cc93bc authored by Ben Gamari's avatar Ben Gamari 🐢

rts: Ensure that the_gc_thread is aligned

Since we cast this to a gc_thread the compiler may assume that it's aligned.
Make sure that this is so. Fixes #15482.
parent ff06176b
......@@ -128,7 +128,11 @@ uint32_t mutlist_MUTVARS,
gc_thread **gc_threads = NULL;
#if !defined(THREADED_RTS)
StgWord8 the_gc_thread[sizeof(gc_thread) + 64 * sizeof(gen_workspace)];
/* Use conservative alignment since we will cast this to a gc_thread and
* consequently the compiler may assume it is aligned. See #15482.
*/
StgWord8 the_gc_thread[sizeof(gc_thread) + 64 * sizeof(gen_workspace)]
__attribute__((aligned(sizeof(W_))));
#endif
// Number of threads running in *this* GC. Affects how many
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment