aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_alloc_util.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-04-22 15:10:58 +0200
committerSverker Eriksson <[email protected]>2013-06-03 14:24:23 +0200
commita14c1590740bb7233400178fa069d71e280f5c8b (patch)
tree38986e93a2156e0d466789278e71930720bb6123 /erts/emulator/beam/erl_alloc_util.c
parent2fab1055580b4c5c00ef23db59b40a1b0b5a9acc (diff)
downloadotp-a14c1590740bb7233400178fa069d71e280f5c8b.tar.gz
otp-a14c1590740bb7233400178fa069d71e280f5c8b.tar.bz2
otp-a14c1590740bb7233400178fa069d71e280f5c8b.zip
erts: Make carrier header sizes customizable
This is a modified partial revert of 2ab1d972f6fd37c17b05
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.c')
-rw-r--r--erts/emulator/beam/erl_alloc_util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index c57ddc424e..bf7d561b00 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -304,7 +304,7 @@ MBC after deallocating first block:
#define SBC_HEADER_SIZE (UNIT_CEILING(sizeof(Carrier_t) + ABLK_HDR_SZ) \
- ABLK_HDR_SZ)
-#define MBC_HEADER_SIZE(AP) SBC_HEADER_SIZE
+#define MBC_HEADER_SIZE(AP) ((AP)->mbc_header_size)
#define MSEG_CARRIER_HDR_FLAG (((UWord) 1) << 0)
@@ -4256,6 +4256,8 @@ erts_alcu_start(Allctr_t *allctr, AllctrInit_t *init)
if (!allctr->get_next_mbc_size)
allctr->get_next_mbc_size = get_next_mbc_size;
+ if (allctr->mbc_header_size < sizeof(Carrier_t))
+ goto error;
#ifdef ERTS_SMP
allctr->dd.use = 0;
if (init->tpref) {
@@ -4264,6 +4266,9 @@ erts_alcu_start(Allctr_t *allctr, AllctrInit_t *init)
allctr->dd.ix = init->ix;
}
#endif
+ allctr->mbc_header_size = (UNIT_CEILING(allctr->mbc_header_size
+ + ABLK_HDR_SZ)
+ - ABLK_HDR_SZ);
if (allctr->main_carrier_size) {
Block_t *blk;