aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-07-29 17:16:53 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-08-01 11:00:22 +0200
commite52fa24451306080be39a35444cf52210982b41a (patch)
treef9e285a9c32330d1e1a0956682551aa0238145fc /erts/emulator/beam/erl_nif.c
parentdbea5c4023ec6ac59bb1988711532682a032536d (diff)
downloadotp-e52fa24451306080be39a35444cf52210982b41a.tar.gz
otp-e52fa24451306080be39a35444cf52210982b41a.tar.bz2
otp-e52fa24451306080be39a35444cf52210982b41a.zip
erts: Refactor literal purge area arguments
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index e1944fff29..6bd27d11f4 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -627,11 +627,12 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
MBUF(&menv->phony_proc) = NULL;
}
} else {
- Eterm *lit_purge_ptr = erts_clrange.ptr;
- Uint lit_purge_sz = erts_clrange.sz;
- Uint sz = size_object_litopt(msg, lit_purge_ptr, lit_purge_sz);
+ erts_literal_area_t litarea;
ErlOffHeap *ohp;
Eterm *hp;
+ Uint sz;
+ INITIALIZE_LITERAL_PURGE_AREA(litarea);
+ sz = size_object_litopt(msg, &litarea);
if (env && !env->tracee) {
flush_env(env);
mp = erts_alloc_message_heap(rp, &rp_locks, sz, &hp, &ohp);
@@ -651,8 +652,7 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
ohp = &bp->off_heap;
}
}
- msg = copy_struct_litopt(msg, sz, &hp, ohp,
- lit_purge_ptr, lit_purge_sz);
+ msg = copy_struct_litopt(msg, sz, &hp, ohp, &litarea);
}
ERL_MESSAGE_TERM(mp) = msg;