summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-27 04:40:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-27 04:40:13 +0000
commit202b4bbe81dc5f5d40df5c779d8f8d20d06e9b70 (patch)
tree5ff9de965607b1c8d6bc09c07328886f55c6c5f5 /gc.c
parent4f517abfdc1ad87886a0f4fc4720a4a859279bb4 (diff)
gc.c: fix no lazy sweep mode
* gc.c (gc_sweep_rest): sweep rest pages regardless of whether lazy sweep is enabled or not. based on the patch by Masahiro Ide at [ruby-dev:48706]. [Bug #10431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gc.c b/gc.c
index a27cc01d03..63eb139445 100644
--- a/gc.c
+++ b/gc.c
@@ -700,7 +700,8 @@ VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#else
#define is_incremental_marking(objspace) 0
#endif
-#define is_lazy_sweeping(heap) (GC_ENABLE_LAZY_SWEEP && (heap)->sweep_pages != 0)
+#define has_sweeping_pages(heap) ((heap)->sweep_pages != 0)
+#define is_lazy_sweeping(heap) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(heap))
#if GC_ENABLE_INCREMENTAL_MARK
#define will_be_incremental_marking(objspace) ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE)
#else
@@ -3315,10 +3316,8 @@ gc_sweep_rest(rb_objspace_t *objspace)
{
rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */
- if (is_lazy_sweeping(heap)) {
- while (is_lazy_sweeping(heap)) {
- gc_sweep_step(objspace, heap);
- }
+ while (has_sweeping_pages(heap)) {
+ gc_sweep_step(objspace, heap);
}
}