aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-11-18 20:12:38 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-11-18 20:12:38 +0100
commit02f038355d16e9b6474837727878f58e4ca669c8 (patch)
treeb70629c7713cf055104e5472f978dcd4e797797f /erts/emulator/beam/erl_process.c
parent8b93e77a6d3df65e45a3ca3e2ec9dd4c52464f63 (diff)
downloadotp-02f038355d16e9b6474837727878f58e4ca669c8.tar.gz
otp-02f038355d16e9b6474837727878f58e4ca669c8.tar.bz2
otp-02f038355d16e9b6474837727878f58e4ca669c8.zip
Use sharing preserving copy error messages and exceptions
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 23616f36bf..f347d57a9d 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11520,31 +11520,44 @@ send_exit_message(Process *to, ErtsProcLocks *to_locksp,
{
ErtsMessage *mp;
ErlOffHeap *ohp;
+ Eterm* hp;
+ Eterm mess;
+#ifdef SHCOPY_SEND
+ erts_shcopy_t info;
+#endif
if (token == NIL
#ifdef USE_VM_PROBES
|| token == am_have_dt_utag
#endif
) {
- Eterm* hp;
- Eterm mess;
-
- mp = erts_alloc_message_heap(to, to_locksp,
- term_size, &hp, &ohp);
+#ifdef SHCOPY_SEND
+ INITIALIZE_SHCOPY(info);
+ term_size = copy_shared_calculate(exit_term, &info);
+ mp = erts_alloc_message_heap(to, to_locksp, term_size, &hp, &ohp);
+ mess = copy_shared_perform(exit_term, term_size, &info, &hp, ohp);
+ DESTROY_SHCOPY(info);
+#else
+ mp = erts_alloc_message_heap(to, to_locksp, term_size, &hp, &ohp);
mess = copy_struct(exit_term, term_size, &hp, ohp);
+#endif
erts_queue_message(to, to_locksp, mp, mess, NIL);
} else {
- Eterm* hp;
- Eterm mess;
Eterm temp_token;
Uint sz_token;
ASSERT(is_tuple(token));
sz_token = size_object(token);
-
- mp = erts_alloc_message_heap(to, to_locksp,
- term_size+sz_token, &hp, &ohp);
+#ifdef SHCOPY_SEND
+ INITIALIZE_SHCOPY(info);
+ term_size = copy_shared_calculate(exit_term, &info);
+ mp = erts_alloc_message_heap(to, to_locksp, term_size, &hp, &ohp);
+ mess = copy_shared_perform(exit_term, term_size, &info, &hp, ohp);
+ DESTROY_SHCOPY(info);
+#else
+ mp = erts_alloc_message_heap(to, to_locksp, term_size+sz_token, &hp, &ohp);
mess = copy_struct(exit_term, term_size, &hp, ohp);
+#endif
/* the trace token must in this case be updated by the caller */
seq_trace_output(token, mess, SEQ_TRACE_SEND, to->common.id, NULL);
temp_token = copy_struct(token, sz_token, &hp, ohp);