aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-11-23 15:12:28 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-11-23 15:12:28 +0100
commit9d2acfb6ad3184c150a9e91520cd320c83e952b4 (patch)
tree7e2cf822f46948aabeb59b85f0639d0f25249537 /erts/emulator/beam/erl_nif.c
parentab1bf8631008ea62443366125c6932db2e2af69a (diff)
parent6ff15f23c68db356bbad6ab5f939c191b58d453d (diff)
downloadotp-9d2acfb6ad3184c150a9e91520cd320c83e952b4.tar.gz
otp-9d2acfb6ad3184c150a9e91520cd320c83e952b4.tar.bz2
otp-9d2acfb6ad3184c150a9e91520cd320c83e952b4.zip
Merge branch 'np/sharing-preserved-copy/OTP-12590'
* np/sharing-preserved-copy/OTP-12590: (28 commits) Refactor have seq_trace token test Use sharing preserving copy error messages and exceptions Use sharing preserving copy in enif_make_copy Refactor sharing preserved copy flags Fix rebase of SHCOPY seq_tokens Fix erts_debug:copy_shared/1 prototype Update preloaded module erlang.beam Add erlang:copy_literals/2 spec Add copy_literals testcase Do not use GCC extensions in copy Use copy literal range check in message passing and purging Add BIF for setting internal copy literal range Copy literals in copy sharing Refactor copy sharing Add support for HAMT maps in preserved copy Fix Map preserved sharing copy implementation Fix Halfword removal Fix internal stacks Add support for maps in preserved copy Add --enable-sharing-preserving configure flag ...
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index a37cda93ef..2ff509e6d0 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -379,9 +379,19 @@ ERL_NIF_TERM enif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term)
{
Uint sz;
Eterm* hp;
+#ifdef SHCOPY
+ erts_shcopy_t info;
+ INITIALIZE_SHCOPY(info);
+ sz = copy_shared_calculate(src_term, &info);
+ hp = alloc_heap(dst_env, sz);
+ src_term = copy_shared_perform(src_term, sz, &info, &hp, &MSO(dst_env->proc));
+ DESTROY_SHCOPY(info);
+ return src_term;
+#else
sz = size_object(src_term);
hp = alloc_heap(dst_env, sz);
return copy_struct(src_term, sz, &hp, &MSO(dst_env->proc));
+#endif
}