aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.c
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-07-12 16:53:05 +0200
committerJohn Högberg <[email protected]>2018-07-12 16:53:05 +0200
commit6f1bdd7817c31e133ad624568f7eaa7d9a59a0bf (patch)
treed347a62e8bb30f2668c83d039bd00cc782b9e6e4 /erts/emulator/beam/erl_alloc_util.c
parente95e03fe54d7e74f9e548398702e35d8df4be0d1 (diff)
parent0af0335f34178992c588d5d3824b5fb838338624 (diff)
downloadotp-6f1bdd7817c31e133ad624568f7eaa7d9a59a0bf.tar.gz
otp-6f1bdd7817c31e133ad624568f7eaa7d9a59a0bf.tar.bz2
otp-6f1bdd7817c31e133ad624568f7eaa7d9a59a0bf.zip
Merge branch 'john/erts/adjust-fix-alloc-sizes'
* john/erts/adjust-fix-alloc-sizes: Adjust fix_alloc sizes to guarantee they fit a dd block
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.c')
-rw-r--r--erts/emulator/beam/erl_alloc_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index 6d6c56956a..b7a8b9c2d0 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -1402,8 +1402,8 @@ fix_cpool_alloc(Allctr_t *allctr, ErtsAlcType_t type, Uint size)
ErtsAlcFixList_t *fix;
fix = &allctr->fix[ERTS_ALC_FIX_TYPE_IX(type)];
- ASSERT(type == fix->type);
- ASSERT(size == fix->type_size);
+ ASSERT(type == fix->type && size == fix->type_size);
+ ASSERT(size >= sizeof(ErtsAllctrDDBlock_t));
res = fix->list;
if (res) {
@@ -1546,6 +1546,7 @@ fix_nocpool_alloc(Allctr_t *allctr, ErtsAlcType_t type, Uint size)
fix = &allctr->fix[ERTS_ALC_FIX_TYPE_IX(type)];
ASSERT(type == fix->type && size == fix->type_size);
+ ASSERT(size >= sizeof(ErtsAllctrDDBlock_t));
ERTS_DBG_CHK_FIX_LIST(allctr, fix, ix, 1);
fix->u.nocpool.used++;
@@ -6607,7 +6608,6 @@ erts_alcu_start(Allctr_t *allctr, AllctrInit_t *init)
allctr->fix[i].type = ERTS_ALC_N2T(i + ERTS_ALC_N_MIN_A_FIXED_SIZE);
allctr->fix[i].list_size = 0;
allctr->fix[i].list = NULL;
- ASSERT(allctr->fix[i].type_size >= sizeof(ErtsAllctrDDBlock_t));
if (ERTS_ALC_IS_CPOOL_ENABLED(allctr)) {
allctr->fix[i].u.cpool.min_list_size = 0;
allctr->fix[i].u.cpool.shrink_list = 0;