when called from check_gen_consistency. It fixes segmentation
fault on RGENGC_CHECK_MODE >= 1 introduced by r47188.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to objspace::rgengc::parent_object (VALUE).
Use Qfalse or RVALUE pointer instead of FALSE and TRUE.
* gc.c (gc_marks_body): should clear parent_object just before
gc_mark_roots() because there are no parents objects
for root objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add GPR_FLAG_MAJOR_BY_FORCE, which indicates
major GC by METHOD, CAPI and so on (see GC_BY).
* remove GPR_FLAG_MAJOR_BY_RESCAN because not used.
* remove GPR_FLAG_MAJOR_BY_STRESS, use FORCE instead.
* test/ruby/test_gc.rb: catch up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c: remove mark function for RubyVM object because
RubyVM object marked manually.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fstrings refered by static symbols and pinned dynamic symbols
are registerd by rb_gc_register_mark_object().
frstring refered by dynamic symbols (not pinned symbols)
are refered from global_symbols.dsymbol_fstr_hash (Hash object).
Note that fstrings refered from dynamic symbols must live loger
than symbol objects themselves because rb_gc_free_dsymbol() uses
fstring to remove from symbol tables.
This is why we can not mark fstrings from dynamic symbols.
This technique reduces root objects for GC marking.
* gc.c (gc_mark_roots): ditto.
* internal.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.h: rb_objspace_garbage_object_p() as an exported function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This function is not opposite against is_live_object()
because is_dying_object() does *not* check object type.
* gc.c (is_dying_object): change condition.
* gc.c (is_live_object): use T_NONE instead of 0.
* gc.c (rb_objspace_dying_object_p): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
From single array, to array of arrays. Each array only has 1024
entries.
* vm.c (Init_vm_objects): change default capa from 1 to 128.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Extend heap only at
(1) after major GC
or
(2) after several (two times, at current) minor GC
Details in https://bugs.ruby-lang.org/issues/9607#note-9
[Bug #9607]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (gc_page_sweep): should not set, but add final_slots into
sweep_page->final_slots.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
clear counter at the beggining of every GC and
count promoted (infant->young) objects.
Some promotions (infant->young) are transition of promoting to old
objects. We should not count such promotions.
With this technique, we don't need to check young objects
at obj_free().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
gc_verify_internal_consistency() counts all
- live objects
- young objects (if age2 promotion)
- old objects
in all pages and compares with objspace managing counters.
* gc.c (gc_after_sweep): do gc_verify_internal_consistency()
when RGENGC_CHECK_MODE >= 2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: use int for simple predicate functions instead of VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
of RVALUE_OLD_P(). clang fails to compile it because is_old is
`int' but RVALUE_OLD_P() returns VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (RVALUE_DEMOTE_FROM_OLD): decrement old object count.
* gc.c (RVALUE_DEMOTE_FROM_YOUNG): decrement young object count.
* gc.c (rb_gc_resurrect): increment old object count.
* gc.c (gc_marks_body): should not add old object count.
This code is completely my misunderstanding.
* gc.c (rb_gc_force_recycle): decrement young or old object count
correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c (rb_free_m_tbl): mark function as static
* method.h (rb_free_m_tbl): remove prototype
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
at the major GC because AGE2Promotion changes all old objects into
young objects at major GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
heap_pages_increment.
For example, GC by exceeding malloc_limit can remain
heap_pages_increment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e