diff options
author | John Högberg <[email protected]> | 2019-04-24 12:45:36 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-04-24 13:23:27 +0200 |
commit | 4fb0813f9004cb75eca065058c4899b0e4183635 (patch) | |
tree | f23b83af9c7d8f1d76c2f5bb816a12d6e1eed963 /erts/emulator/beam/erl_alloc_util.h | |
parent | 90eb43d0b61b5a51aede0537e394bd02216b6fa0 (diff) | |
download | otp-4fb0813f9004cb75eca065058c4899b0e4183635.tar.gz otp-4fb0813f9004cb75eca065058c4899b0e4183635.tar.bz2 otp-4fb0813f9004cb75eca065058c4899b0e4183635.zip |
erts_alloc: Fix incorrect header word packing
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.h')
-rw-r--r-- | erts/emulator/beam/erl_alloc_util.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h index ea1afe8f58..b34916271e 100644 --- a/erts/emulator/beam/erl_alloc_util.h +++ b/erts/emulator/beam/erl_alloc_util.h @@ -334,8 +334,9 @@ void erts_alcu_sched_spec_data_init(struct ErtsSchedulerData_ *esdp); #endif #if MBC_ABLK_OFFSET_BITS -# define MBC_ABLK_OFFSET_SHIFT (sizeof(UWord)*8 - MBC_ABLK_OFFSET_BITS) -# define MBC_ABLK_OFFSET_MASK ((~((UWord)0) << MBC_ABLK_OFFSET_SHIFT) & ~BLK_FLG_MASK) +/* The shift is reduced by 1 since the highest bit is used for a flag. */ +# define MBC_ABLK_OFFSET_SHIFT (sizeof(UWord)*8 - 1 - MBC_ABLK_OFFSET_BITS) +# define MBC_ABLK_OFFSET_MASK (((1ul << MBC_ABLK_OFFSET_BITS) - 1ul) << MBC_ABLK_OFFSET_SHIFT) # define MBC_ABLK_SZ_MASK (~MBC_ABLK_OFFSET_MASK & ~BLK_FLG_MASK) #else # define MBC_ABLK_SZ_MASK (~BLK_FLG_MASK) |