aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_unicode.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-01-24 15:11:28 +0100
committerRickard Green <[email protected]>2017-02-06 19:54:49 +0100
commit40d55ced08579e9fc0ade28ba0810bf800690394 (patch)
tree1ed70cb936e35b0d53fe3868b6fd3b72e8599da0 /erts/emulator/beam/erl_unicode.c
parent3bdb334a95e9dd49c1ada55b6f442099fdf7f72b (diff)
downloadotp-40d55ced08579e9fc0ade28ba0810bf800690394.tar.gz
otp-40d55ced08579e9fc0ade28ba0810bf800690394.tar.bz2
otp-40d55ced08579e9fc0ade28ba0810bf800690394.zip
Use magic refs for unicode static NIFs traps
Diffstat (limited to 'erts/emulator/beam/erl_unicode.c')
-rw-r--r--erts/emulator/beam/erl_unicode.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index 8919898181..dd7c589c3d 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -129,13 +129,9 @@ static void cleanup_restart_context_bin(Binary *bp)
cleanup_restart_context(rc);
}
-static RestartContext *get_rc_from_bin(Eterm bin)
+static RestartContext *get_rc_from_bin(Eterm mref)
{
- Binary *mbp;
- ASSERT(ERTS_TERM_IS_MAGIC_BINARY(bin));
-
- mbp = ((ProcBin *) binary_val(bin))->val;
-
+ Binary *mbp = erts_magic_ref2bin(mref);
ASSERT(ERTS_MAGIC_BIN_DESTRUCTOR(mbp)
== cleanup_restart_context_bin);
return (RestartContext *) ERTS_MAGIC_BIN_DATA(mbp);
@@ -148,8 +144,8 @@ static Eterm make_magic_bin_for_restart(Process *p, RestartContext *rc)
RestartContext *restartp = ERTS_MAGIC_BIN_DATA(mbp);
Eterm *hp;
memcpy(restartp,rc,sizeof(RestartContext));
- hp = HAlloc(p, PROC_BIN_SIZE);
- return erts_mk_magic_binary_term(&hp, &MSO(p), mbp);
+ hp = HAlloc(p, ERTS_MAGIC_REF_THING_SIZE);
+ return erts_mk_magic_ref(&hp, &MSO(p), mbp);
}