summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-08-21 16:06:12 -0400
committerBen Gamari <ben@smart-cactus.org>2018-08-21 18:56:12 -0400
commit68a1fc29b4bb3eae54e4d96c9aec20e700040f34 (patch)
treec70deea4bc9c730f983f30854e2d4475a4c76a34 /rts
parentdcf27e6f78529e7e471a4be64ca47398eb1b6b52 (diff)
downloadhaskell-68a1fc29b4bb3eae54e4d96c9aec20e700040f34.tar.gz
rts: Align the_gc_thread to 64 bytes
In a previous attempt (c6cc93bca69abc258513af8cf2370b14e70fd8fb) I had tried aligning to 8 bytes under the assumption that the problem was that the_gc_thread, a StgWord8[], wasn't being aligned to 8-bytes as the gc_thread struct would expect. However, we actually need even stronger alignment due to the alignment attribute attached to gen_workspace, which claims it should be aligned to a 64-byte boundary. This fixes #15482. Reviewers: erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15482 Differential Revision: https://phabricator.haskell.org/D5052
Diffstat (limited to 'rts')
-rw-r--r--rts/sm/GC.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 742ae360c5..90857abe38 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -128,7 +128,9 @@ uint32_t mutlist_MUTVARS,
gc_thread **gc_threads = NULL;
#if !defined(THREADED_RTS)
-StgWord8 the_gc_thread[sizeof(gc_thread) + 64 * sizeof(gen_workspace)];
+// Must be aligned to 64-bytes to meet stated 64-byte alignment of gen_workspace
+StgWord8 the_gc_thread[sizeof(gc_thread) + 64 * sizeof(gen_workspace)]
+ ATTRIBUTE_ALIGNED(64);
#endif
// Number of threads running in *this* GC. Affects how many