diff options
author | Rickard Green <rickard@erlang.org> | 2017-01-23 17:07:23 +0100 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2017-02-06 19:54:48 +0100 |
commit | 5a97997217e5c3f901e8fefbd7bbf6c64652c9a8 (patch) | |
tree | bc7ebe05fcc7027997098d8c35c6c377dc731286 /erts/emulator/hipe/hipe_bif0.c | |
parent | 7c70239985c4591ef2770a59a1bf62b51f5108cc (diff) | |
download | erlang-5a97997217e5c3f901e8fefbd7bbf6c64652c9a8.tar.gz |
Use magic refs for code loading state
Diffstat (limited to 'erts/emulator/hipe/hipe_bif0.c')
-rw-r--r-- | erts/emulator/hipe/hipe_bif0.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c index 3011860e51..688c82ab7a 100644 --- a/erts/emulator/hipe/hipe_bif0.c +++ b/erts/emulator/hipe/hipe_bif0.c @@ -381,12 +381,9 @@ BIF_RETTYPE hipe_bifs_ref_set_2(BIF_ALIST_2) static HipeLoaderState *get_loader_state(Eterm term) { - ProcBin *pb; + if (!is_internal_magic_ref(term)) return NULL; - if (!ERTS_TERM_IS_MAGIC_BINARY(term)) return NULL; - - pb = (ProcBin*) binary_val(term); - return hipe_get_loader_state(pb->val); + return hipe_get_loader_state(erts_magic_ref2bin(term)); } @@ -1982,8 +1979,8 @@ BIF_RETTYPE hipe_bifs_alloc_loader_state_1(BIF_ALIST_1) if (!magic) BIF_ERROR(BIF_P, BADARG); - hp = HAlloc(BIF_P, PROC_BIN_SIZE); - res = erts_mk_magic_binary_term(&hp, &MSO(BIF_P), magic); + hp = HAlloc(BIF_P, ERTS_MAGIC_REF_THING_SIZE); + res = erts_mk_magic_ref(&hp, &MSO(BIF_P), magic); erts_refc_dec(&magic->refc, 1); BIF_RET(res); } |