aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_gc.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2012-11-23 16:19:03 +0100
committerPatrik Nyblom <[email protected]>2012-11-23 16:19:03 +0100
commita22418d1e18deb952bb065e52fda1f25309314a9 (patch)
treeb9d3799792c0af6737034099f1786ead088b04a0 /erts/emulator/beam/erl_gc.c
parentd8d53aefc3234a37ad9308949d122c265f90cca9 (diff)
parentb628ebe21a7b449eea27ada811dfbb007afe6d0b (diff)
downloadotp-a22418d1e18deb952bb065e52fda1f25309314a9.tar.gz
otp-a22418d1e18deb952bb065e52fda1f25309314a9.tar.bz2
otp-a22418d1e18deb952bb065e52fda1f25309314a9.zip
Merge branch 'pan/bs_append_crash' into maint
* pan/bs_append_crash: Teach erts_bs_append not to dump core OTP-10590
Diffstat (limited to 'erts/emulator/beam/erl_gc.c')
-rw-r--r--erts/emulator/beam/erl_gc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 52a6e52e6c..e2689f58c3 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -336,6 +336,19 @@ erts_gc_after_bif_call(Process* p, Eterm result, Eterm* regs, Uint arity)
return result;
}
+static ERTS_INLINE void reset_active_writer(Process *p)
+{
+ struct erl_off_heap_header* ptr;
+ ptr = MSO(p).first;
+ while (ptr) {
+ if (ptr->thing_word == HEADER_PROC_BIN) {
+ ProcBin *pbp = (ProcBin*) ptr;
+ pbp->flags &= ~PB_ACTIVE_WRITER;
+ }
+ ptr = ptr->next;
+ }
+}
+
/*
* Garbage collect a process.
*
@@ -395,6 +408,7 @@ erts_garbage_collect(Process* p, int need, Eterm* objv, int nobj)
DTRACE2(gc_minor_end, pidbuf, reclaimed_now);
}
}
+ reset_active_writer(p);
/*
* Finish.
@@ -2181,7 +2195,6 @@ link_live_proc_bin(struct shrink_cand_data *shrink,
if (pbp->flags & PB_ACTIVE_WRITER) {
- pbp->flags &= ~PB_ACTIVE_WRITER;
shrink->no_of_active++;
}
else { /* inactive */