aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-23 06:43:06 +0200
committerBjörn Gustavsson <[email protected]>2017-10-01 07:08:19 +0200
commit9de3ee84b934ea373a4ce7d9dbb5b59a15cc2094 (patch)
tree27b808fd3906054d349aef4ede035ee70f21678f /erts/emulator/beam/beam_emu.c
parent72f0f6d16d1aa06205aa2efba9a4b17ea1f8d849 (diff)
downloadotp-9de3ee84b934ea373a4ce7d9dbb5b59a15cc2094.tar.gz
otp-9de3ee84b934ea373a4ce7d9dbb5b59a15cc2094.tar.bz2
otp-9de3ee84b934ea373a4ce7d9dbb5b59a15cc2094.zip
Add CHECK_ALIGNED() for testing storage destinations
Add the CHECK_ALIGNED() macro that can be used for testing that the storage destination is word-aligned.
Diffstat (limited to 'erts/emulator/beam/beam_emu.c')
-rw-r--r--erts/emulator/beam/beam_emu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index b412cf8b79..9a77c63390 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -106,6 +106,8 @@ do { \
# define CHECK_ARGS(T)
#endif
+#define CHECK_ALIGNED(Dst) ASSERT((((Uint)&Dst) & (sizeof(Uint)-1)) == 0)
+
#define GET_BIF_MODULE(p) (p->info.mfa.module)
#define GET_BIF_FUNCTION(p) (p->info.mfa.function)
#define GET_BIF_ARITY(p) (p->info.mfa.arity)