aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_message.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-11-18 16:59:08 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-11-18 17:39:39 +0100
commit3f29cf1f72f50d20ce1864f76e1a298602429ca4 (patch)
treeb53c4d737dea9533b603fa02adf453d84410844c /erts/emulator/beam/erl_message.c
parent15c26af0a35fb482408885ea90b3e669d64d71f0 (diff)
downloadotp-3f29cf1f72f50d20ce1864f76e1a298602429ca4.tar.gz
otp-3f29cf1f72f50d20ce1864f76e1a298602429ca4.tar.bz2
otp-3f29cf1f72f50d20ce1864f76e1a298602429ca4.zip
Fix rebase of SHCOPY seq_tokens
Diffstat (limited to 'erts/emulator/beam/erl_message.c')
-rw-r--r--erts/emulator/beam/erl_message.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/erts/emulator/beam/erl_message.c b/erts/emulator/beam/erl_message.c
index 11890a756d..66b337402d 100644
--- a/erts/emulator/beam/erl_message.c
+++ b/erts/emulator/beam/erl_message.c
@@ -691,22 +691,15 @@ erts_send_message(Process* sender,
#ifdef USE_VM_PROBES
Uint dt_utag_size = 0;
#endif
-#ifdef SHCOPY_SEND
- unsigned shflags = (flags & ERTS_SND_FLG_SHCOPY_MASK) >> ERTS_SND_FLG_SHCOPY_SHIFT;
- erts_shcopy_t info;
- INITIALIZE_SHCOPY(info);
-#endif
- BM_SWAP_TIMER(send,size);
-#ifdef SHCOPY_SEND
- INITIALIZE_SHCOPY(info);
- msize = copy_shared_calculate(message, &info, shflags);
-#else
- msize = size_object(message);
-#endif
- BM_SWAP_TIMER(size,send);
+ BM_SWAP_TIMER(send,size);
+ /* SHCOPY corrupts the heap between
+ * copy_shared_calculate, and
+ * copy_shared_perform. (it inserts move_markers like the gc).
+ * Make sure we don't use the heap between those instances.
+ */
#ifdef USE_VM_PROBES
- if (stoken != am_have_dt_utag) {
+ if (stoken != am_have_dt_utag) {
#endif
seq_trace_update_send(sender);
seq_trace_output(stoken, message, SEQ_TRACE_SEND,
@@ -714,23 +707,31 @@ erts_send_message(Process* sender,
seq_trace_size = 6; /* TUPLE5 */
#ifdef USE_VM_PROBES
}
- if (DT_UTAG_FLAGS(sender) & DT_UTAG_SPREADING) {
- dt_utag_size = size_object(DT_UTAG(sender));
- } else if (stoken == am_have_dt_utag ) {
- stoken = NIL;
- }
+ if (DT_UTAG_FLAGS(sender) & DT_UTAG_SPREADING) {
+ dt_utag_size = size_object(DT_UTAG(sender));
+ } else if (stoken == am_have_dt_utag ) {
+ stoken = NIL;
+ }
+#endif
+
+#ifdef SHCOPY_SEND
+ INITIALIZE_SHCOPY(info);
+ msize = copy_shared_calculate(message, &info, shflags);
+#else
+ msize = size_object(message);
#endif
+ BM_SWAP_TIMER(size,send);
- mp = erts_alloc_message_heap_state(receiver,
- &receiver_state,
- receiver_locks,
- (msize
+ mp = erts_alloc_message_heap_state(receiver,
+ &receiver_state,
+ receiver_locks,
+ (msize
#ifdef USE_VM_PROBES
- + dt_utag_size
+ + dt_utag_size
#endif
- + seq_trace_size),
- &hp,
- &ohp);
+ + seq_trace_size),
+ &hp,
+ &ohp);
BM_SWAP_TIMER(send,copy);