diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-07-29 12:19:11 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-08-01 11:00:22 +0200 |
commit | 13ec43880b8565a5ddd7da590c36a520d4ff4b26 (patch) | |
tree | 3e14d5bd5aafa59007173651329a493860d313cb /erts | |
parent | a9368b3c1ee78a3c83fcff83590a3d94ea4ddbe0 (diff) | |
download | otp-13ec43880b8565a5ddd7da590c36a520d4ff4b26.tar.gz otp-13ec43880b8565a5ddd7da590c36a520d4ff4b26.tar.bz2 otp-13ec43880b8565a5ddd7da590c36a520d4ff4b26.zip |
erts: Don't copy literals in enif_send
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/erl_nif.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index c6127a4967..e1944fff29 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -627,7 +627,9 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid, MBUF(&menv->phony_proc) = NULL; } } else { - Uint sz = size_object(msg); + 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); ErlOffHeap *ohp; Eterm *hp; if (env && !env->tracee) { @@ -649,7 +651,8 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid, ohp = &bp->off_heap; } } - msg = copy_struct(msg, sz, &hp, ohp); + msg = copy_struct_litopt(msg, sz, &hp, ohp, + lit_purge_ptr, lit_purge_sz); } ERL_MESSAGE_TERM(mp) = msg; |