summaryrefslogtreecommitdiff
path: root/test/ruby/test_gc_compact.rb
AgeCommit message (Collapse)Author
2020-01-27Moved `GC.verify_compaction_references` to gc.rbNobuyoshi Nakada
And fixed a segfault by coercion of `Qundef`, when any keyword argument without `toward:` option is given.
2019-11-07Add a counter for compactionAaron Patterson
Keep track of the number of times the compactor ran. I would like to use this as a way to keep track of inline cache reference updates.
2019-11-07Use a monotonically increasing number for object_idJohn Hawthorn
This changes object_id from being based on the objects location in memory (or a nearby memory location in the case of a conflict) to be based on an always increasing number. This number is a Ruby Integer which allows it to overflow the size of a pointer without issue (very unlikely to happen in real programs especially on 64-bit, but a nice guarantee). This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby objects to Ruby objects (previously they were Ruby object to C integer) which simplifies updating them after compaction as we can run them through gc_update_table_refs. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2019-11-06Revert "Use a monotonically increasing number for object_id"Aaron Patterson
This reverts commit bd2b314a05ae9192b3143e1e678a37c370d8a9ce.
2019-11-06Use a monotonically increasing number for object_idJohn Hawthorn
This changes object_id from being based on the objects location in memory (or a nearby memory location in the case of a conflict) to be based on an always increasing number. This number is a Ruby Integer which allows it to overflow the size of a pointer without issue (very unlikely to happen in real programs especially on 64-bit, but a nice guarantee). This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby objects to Ruby objects (previously they were Ruby object to C integer) which simplifies updating them after compaction as we can run them through gc_update_table_refs. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/2638
2019-09-26Add compaction support to `rb_ast_t`Aaron Patterson
This commit adds compaction support to `rb_ast_t`.
2019-06-30Skip instead of returnNobuyoshi Nakada
2019-06-30Suppress unused variable warningsNobuyoshi Nakada
2019-05-23Test GC.compact with MJIT againTakashi Kokubun
2019-05-23Do not kick finalizers on rb_gc().Koichi Sasada
rb_gc() kicks gc_finalize_deferred(), which invokes finalizers. This means that any Ruby program can be run this point and it may be thread switching points and so on. However, it is difficult to think it invokes any Ruby programs. For example, `GC.compact` use `rb_gc()` to implement it, howver, any Ruby program must not be run on this timing. For this reason (it is difficult to image it run any Ruby program), I removed `gc_finalize_deferred()` line in rb_gc(). This patch solves GC.compact issue. [Bug #15809] and re-enable GC.compact test.
2019-05-21re-skip tests of GC.compact.Koichi Sasada
2019-05-21enable test for GC.compact to reproduce an issue on CIKoichi Sasada
2019-05-17skip tests for GC.compact to pass CI.Koichi Sasada
Now, GC.compact has issues which makes rubyci RED, so I skip this test and debug soon.
2019-05-14Add object packing strategies for compactionAaron Patterson
This commit adds an alternative packing strategy for compaction. Instead of packing towards "most pinned" pages, we can pack towards "most empty" pages. The idea is that we can double the heap size, then pack all objects towards the empty side of the heap. This will ensure maximum chaos for testing / verification.
2019-04-23Fix complex hash keys to work with compactionAaron Patterson
For example when an array containing objects is a hash key, the contents of the array may move which can cause the hash value for the array to change. This commit makes the default `hash` value based off the object id, so the hash value will remain stable. Fixes test/shell/test_command_processor.rb
2019-04-20skip test until we can guarantee movement of certain objectstenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20skip test if mjit is enabledtenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Workaround Wercker check which is not working nowk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Skip test_find_collided_object on problematic CIs for nowk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20add more assertions around moved objecttenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20check the index rather than includetenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Try harder to make objects movetenderlove
Sometimes the objects we allocated may not get compacted. This change is to increase the likelyhood that they will move git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20Add `GC.compact` again.tenderlove
🙏 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Reverting compaction for nowtenderlove
For some reason symbols (or classes) are being overridden in trunk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17call verification method in addition to compactiontenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-17Adding `GC.compact` and compacting GC support.tenderlove
This commit adds the new method `GC.compact` and compacting GC support. Please see this issue for caveats: https://bugs.ruby-lang.org/issues/15626 [Feature #15626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-10Reverting all commits from r67479 to r67496 because of CI failureskazu
Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Don't fail the build if we can't get objects to movetenderlove
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Try to make compaction more likelytenderlove
This commit tries to make compaction more likely by allocating some objects and then throwing them away git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-09Adding `GC.compact` and compacting GC support.tenderlove
This commit adds the new method `GC.compact` and compacting GC support. Please see this issue for caveats: https://bugs.ruby-lang.org/issues/15626 [Feature #15626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e