aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-05-21 15:53:29 +0200
committerSverker Eriksson <[email protected]>2013-06-03 14:24:24 +0200
commit473612d16e75e8c01cbf7725205418700c389759 (patch)
tree43f0b8fd11172dafd4530caf7ad3b11673308c44 /erts/emulator/beam
parent5803c8c83ea7b44127d3d4e80b0a4ea308f5f4e9 (diff)
downloadotp-473612d16e75e8c01cbf7725205418700c389759.tar.gz
otp-473612d16e75e8c01cbf7725205418700c389759.tar.bz2
otp-473612d16e75e8c01cbf7725205418700c389759.zip
erts: Add test for add_mbc and remove_mbc callbacks
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_alloc_util.c3
-rw-r--r--erts/emulator/beam/erl_ao_firstfit_alloc.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index ce66727fae..67cc4ae62a 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -4404,8 +4404,11 @@ erts_alcu_test(UWord op, UWord a1, UWord a2)
case 0x01a: return (UWord) IS_MBC_FIRST_BLK((Allctr_t*)a1, (Block_t *) a2);
case 0x01b: return (UWord) sizeof(Unit_t);
case 0x01c: return (unsigned long) BLK_TO_MBC((Block_t*) a1);
+ case 0x01d: ((Allctr_t*) a1)->add_mbc((Allctr_t*)a1, (Carrier_t*)a2, 0); break;
+ case 0x01e: ((Allctr_t*) a1)->remove_mbc((Allctr_t*)a1, (Carrier_t*)a2, 0); break;
default: ASSERT(0); return ~((UWord) 0);
}
+ return 0;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
diff --git a/erts/emulator/beam/erl_ao_firstfit_alloc.c b/erts/emulator/beam/erl_ao_firstfit_alloc.c
index 5d7e6f94a8..98dd98bb14 100644
--- a/erts/emulator/beam/erl_ao_firstfit_alloc.c
+++ b/erts/emulator/beam/erl_ao_firstfit_alloc.c
@@ -988,7 +988,7 @@ erts_aoffalc_test(UWord op, UWord a1, UWord a2)
case 0x501: {
AOFF_RBTree_t *node = ((AOFFAllctr_t *) a1)->mbc_root;
Uint size = (Uint) a2;
- node = rbt_search(node, size);
+ node = node ? rbt_search(node, size) : NULL;
return (UWord) (node ? RBT_NODE_TO_MBC(node)->root : NULL);
}
case 0x502: return (UWord) ((AOFF_RBTree_t *) a1)->parent;