aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-05-25 20:38:03 +0200
committerSverker Eriksson <[email protected]>2016-05-26 12:14:05 +0200
commit770442cd4775a9bc56b3d0476754d8ea91ca2e2f (patch)
tree39236ec0a76508eb15759c283f2a1ad7caf8c70f
parent17cca30753584021dc1c518fffa42f4629a73775 (diff)
downloadotp-770442cd4775a9bc56b3d0476754d8ea91ca2e2f.tar.gz
otp-770442cd4775a9bc56b3d0476754d8ea91ca2e2f.tar.bz2
otp-770442cd4775a9bc56b3d0476754d8ea91ca2e2f.zip
erts: Add some more use of ErtsContainerStruct
-rw-r--r--erts/emulator/beam/erl_ao_firstfit_alloc.c2
-rw-r--r--erts/emulator/beam/export.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_ao_firstfit_alloc.c b/erts/emulator/beam/erl_ao_firstfit_alloc.c
index fbe4724047..7e239d1f5d 100644
--- a/erts/emulator/beam/erl_ao_firstfit_alloc.c
+++ b/erts/emulator/beam/erl_ao_firstfit_alloc.c
@@ -123,7 +123,7 @@ struct AOFF_Carrier_t_ {
AOFF_RBTree_t rbt_node; /* My node in the carrier tree */
AOFF_RBTree_t* root; /* Root of my block tree */
};
-#define RBT_NODE_TO_MBC(PTR) ((AOFF_Carrier_t*)((char*)(PTR) - offsetof(AOFF_Carrier_t, rbt_node)))
+#define RBT_NODE_TO_MBC(PTR) ErtsContainerStruct((PTR), AOFF_Carrier_t, rbt_node)
/*
To support carrier migration we keep two kinds of rb-trees:
diff --git a/erts/emulator/beam/export.c b/erts/emulator/beam/export.c
index cfe7c06823..2a19211987 100644
--- a/erts/emulator/beam/export.c
+++ b/erts/emulator/beam/export.c
@@ -79,8 +79,7 @@ struct export_templ
static struct export_blob* entry_to_blob(struct export_entry* ee)
{
- return (struct export_blob*)
- ((char*)ee->ep - offsetof(struct export_blob,exp));
+ return ErtsContainerStruct(ee->ep, struct export_blob, exp);
}
void