aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_gc.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-06-01 19:56:07 +0200
committerRickard Green <[email protected]>2017-06-01 19:56:07 +0200
commit5f902e2dbc791373d66f4542a153b827d6b34cb7 (patch)
tree6c53194bc97576561795a056d9d549b47609fa86 /erts/emulator/beam/erl_gc.c
parent2b41d8f318b7e5ec139d42fd2f01a132699be839 (diff)
parentc8f1d8218a2aa01a2b8d4f65af6e07e5ca2b631e (diff)
downloadotp-5f902e2dbc791373d66f4542a153b827d6b34cb7.tar.gz
otp-5f902e2dbc791373d66f4542a153b827d6b34cb7.tar.bz2
otp-5f902e2dbc791373d66f4542a153b827d6b34cb7.zip
Merge branch 'rickard/purge-hibernated' into rickard/purge-hibernated-19
* rickard/purge-hibernated: Do not GC hibernated process from other processes Fix check_process_code() on hibernated process Conflicts: erts/emulator/beam/beam_bif_load.c erts/emulator/beam/erl_gc.c erts/emulator/beam/erl_process.h
Diffstat (limited to 'erts/emulator/beam/erl_gc.c')
-rw-r--r--erts/emulator/beam/erl_gc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 6f641a1ea7..adba3c1d62 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -738,7 +738,7 @@ do_major_collection:
esdp->gc_info.garbage_cols++;
esdp->gc_info.reclaimed += reclaimed_now;
- FLAGS(p) &= ~F_FORCE_GC;
+ FLAGS(p) &= ~(F_FORCE_GC|F_HIBERNATED);
p->live_hf_end = ERTS_INVALID_HFRAG_PTR;
ERTS_MSACC_POP_STATE_M();
@@ -903,6 +903,8 @@ erts_garbage_collect_hibernate(Process* p)
ErtsGcQuickSanityCheck(p);
+ p->flags |= F_HIBERNATED;
+
erts_smp_atomic32_read_band_nob(&p->state, ~ERTS_PSFLG_GC);
reds = gc_cost(actual_size, actual_size);
@@ -1132,6 +1134,7 @@ erts_garbage_collect_literals(Process* p, Eterm* literals,
/*
* Restore status.
*/
+ p->flags &= ~F_HIBERNATED;
erts_smp_atomic32_read_band_nob(&p->state, ~ERTS_PSFLG_GC);
}