diff options
author | Cheng Shao <terrorjack@type.dance> | 2023-02-06 17:37:14 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-02-14 11:32:26 -0500 |
commit | 1928c7f3e9dfc13226e8cf786a565d42df6dad41 (patch) | |
tree | d8f9ec7ba6ff78a1a6e6e67d27f408a565969a92 /rts/sm/NonMoving.h | |
parent | 9fb4ca89bff9873e5f6a6849fa22a349c94deaae (diff) | |
download | haskell-1928c7f3e9dfc13226e8cf786a565d42df6dad41.tar.gz |
rts: make it possible to change mblock size on 32-bit targets
The MBLOCK_SHIFT macro must be the single source of truth for defining
the mblock size, and changing it should only affect performance, not
correctness. This patch makes it truly possible to reconfigure mblock
size, at least on 32-bit targets, by fixing places which implicitly
relied on the previous MBLOCK_SHIFT constant. Fixes #22901.
Diffstat (limited to 'rts/sm/NonMoving.h')
-rw-r--r-- | rts/sm/NonMoving.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rts/sm/NonMoving.h b/rts/sm/NonMoving.h index 1f0f68fac6..d88a203dcb 100644 --- a/rts/sm/NonMoving.h +++ b/rts/sm/NonMoving.h @@ -29,6 +29,8 @@ GHC_STATIC_ASSERT(NONMOVING_SEGMENT_SIZE % BLOCK_SIZE == 0, "non-moving segment size must be multiple of block size"); +GHC_STATIC_ASSERT(NONMOVING_SEGMENT_BLOCKS * 2 <= BLOCKS_PER_MBLOCK, "non-moving segment size must not exceed half of mblock size"); + // The index of a block within a segment typedef uint16_t nonmoving_block_idx; |