pad step_workspace to 64 bytes, to speed up access to gct->steps[]

parent a370654a
......@@ -38,6 +38,12 @@ extern "C" {
#define FLEXIBLE_ARRAY 0
#endif
#if __GNUC__ >= 3
#define ATTRIBUTE_ALIGNED(n) __attribute__((aligned(n)))
#else
#define ATTRIBUTE_ALIGNED(n) /*nothing*/
#endif
/* Fix for mingw stat problem (done here so it's early enough) */
#ifdef mingw32_HOST_OS
#define __MSVCRT__ 1
......
......@@ -203,6 +203,9 @@ GarbageCollect ( rtsBool force_major_gc )
}
#endif
ASSERT(sizeof(step_workspace) == 16 * sizeof(StgWord));
// otherwise adjust the padding in step_workspace.
// tell the stats department that we've started a GC
stat_startGC();
......
......@@ -95,7 +95,11 @@ typedef struct step_workspace_ {
bdescr * part_list;
unsigned int n_part_blocks; // count of above
} step_workspace;
StgWord pad[5];
} step_workspace ATTRIBUTE_ALIGNED(64);
// align so that computing gct->steps[n] is a shift, not a multiply
// fails if the size is <64, which is why we need the pad above
/* ----------------------------------------------------------------------------
GC thread object
......
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