aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-12-02 17:37:13 +0100
committerSverker Eriksson <[email protected]>2014-12-02 17:37:13 +0100
commitb3e52c026ce4920e1a4e36ef98e5de94666e91ef (patch)
treeacd32450496744ade5043d8b56cb32b5f3dae1c2 /erts/emulator/beam/io.c
parentc0067390b80f015a0342284505543d099b9e20e6 (diff)
downloadotp-b3e52c026ce4920e1a4e36ef98e5de94666e91ef.tar.gz
otp-b3e52c026ce4920e1a4e36ef98e5de94666e91ef.tar.bz2
otp-b3e52c026ce4920e1a4e36ef98e5de94666e91ef.zip
erts: Add compile time assert ERTS_CT_ASSERT
and usage
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 4d262ff022..d46ac9b336 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -391,7 +391,7 @@ static Port *create_port(char *name,
/* Set default tracing */
erts_get_default_tracing(&ERTS_TRACE_FLAGS(prt), &ERTS_TRACER_PROC(prt));
- ASSERT(((char *) prt) == ((char *) &prt->common));
+ ERTS_CT_ASSERT(offsetof(Port,common) == 0);
#if !ERTS_PORT_INIT_INSTR_NEED_ID
/*
@@ -6698,7 +6698,7 @@ static void ref_to_driver_monitor(Eterm ref, ErlDrvMonitor *mon)
{
RefThing *refp;
ASSERT(is_internal_ref(ref));
- ASSERT(sizeof(RefThing) <= sizeof(ErlDrvMonitor));
+ ERTS_CT_ASSERT(sizeof(RefThing) <= sizeof(ErlDrvMonitor));
refp = ref_thing_ptr(ref);
memset(mon,0,sizeof(ErlDrvMonitor));
memcpy(mon,refp,sizeof(RefThing));