* 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
This commit is contained in:
nobu 2014-10-27 04:40:13 +00:00
Родитель 4f517abfdc
Коммит 202b4bbe81
2 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Mon Oct 27 13:40:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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]
Mon Oct 27 11:18:32 2014 Eric Wong <e@80x24.org> Mon Oct 27 11:18:32 2014 Eric Wong <e@80x24.org>
* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking): * test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):

9
gc.c
Просмотреть файл

@ -700,7 +700,8 @@ VALUE *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#else #else
#define is_incremental_marking(objspace) 0 #define is_incremental_marking(objspace) 0
#endif #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 #if GC_ENABLE_INCREMENTAL_MARK
#define will_be_incremental_marking(objspace) ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE) #define will_be_incremental_marking(objspace) ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE)
#else #else
@ -3315,10 +3316,8 @@ gc_sweep_rest(rb_objspace_t *objspace)
{ {
rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */ rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */
if (is_lazy_sweeping(heap)) { while (has_sweeping_pages(heap)) {
while (is_lazy_sweeping(heap)) { gc_sweep_step(objspace, heap);
gc_sweep_step(objspace, heap);
}
} }
} }