diff options
author | John Högberg <[email protected]> | 2018-07-06 09:49:18 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-07-09 09:55:14 +0200 |
commit | 0af0335f34178992c588d5d3824b5fb838338624 (patch) | |
tree | d1db3259fe0c337e1d5a4d559471189b892b56d4 /erts/emulator/beam/erl_alloc.c | |
parent | 6cfa8af60a9c6fe9043e4992434d40d4a34019e3 (diff) | |
download | otp-0af0335f34178992c588d5d3824b5fb838338624.tar.gz otp-0af0335f34178992c588d5d3824b5fb838338624.tar.bz2 otp-0af0335f34178992c588d5d3824b5fb838338624.zip |
Adjust fix_alloc sizes to guarantee they fit a dd block
This failed on 32-bit builds, and wasn't noticed because 32-bit
debug builds didn't run during the test period.
Diffstat (limited to 'erts/emulator/beam/erl_alloc.c')
-rw-r--r-- | erts/emulator/beam/erl_alloc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index 493c3799c2..166d5c48a5 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -568,7 +568,10 @@ static void adjust_fix_alloc_sizes(UWord extra_block_size) for (i=0; i < tspec->size; i++) { Allctr_t* allctr = tspec->allctr[i]; for (j=0; j < ERTS_ALC_NO_FIXED_SIZES; ++j) { - allctr->fix[j].type_size += extra_block_size; + size_t size = allctr->fix[j].type_size; + size = MAX(size + extra_block_size, + sizeof(ErtsAllctrDDBlock_t)); + allctr->fix[j].type_size = size; } } } @@ -576,8 +579,11 @@ static void adjust_fix_alloc_sizes(UWord extra_block_size) { Allctr_t* allctr = erts_allctrs_info[ERTS_ALC_A_FIXED_SIZE].extra; for (j=0; j < ERTS_ALC_NO_FIXED_SIZES; ++j) { - allctr->fix[j].type_size += extra_block_size; - } + size_t size = allctr->fix[j].type_size; + size = MAX(size + extra_block_size, + sizeof(ErtsAllctrDDBlock_t)); + allctr->fix[j].type_size = size; + } } } } |