From 7630957ebaaf982575f93a6e7ebfd08d679e6293 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 12 Aug 2015 12:18:51 +0000 Subject: iseq.c (iseq_memsize): reimplement for wrapper * iseq.c (iseq_memsize): reimplement for wrapper (param_keyword_size): extracted from iseq_memsize (iseqw_mark): new mark function (iseqw_data_type): new data type (iseqw_new): wrap as iseqw_data_type (iseqw_check): adjust for wrapper (Init_ISeq): remove iseqw_iseq_key initialization * test/objspace/test_objspace.rb: new test [ruby-core:70344] [Feature #11435] v2 changes: - added RUBY_TYPED_WB_PROTECTED and write barrier - account for rb_call_info_kw_arg_t entries git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/objspace/test_objspace.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/objspace') diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 01f31cc784..3036b879bb 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -88,6 +88,12 @@ class TestObjSpace < Test::Unit::TestCase assert_not_empty(res) end + def test_memsize_of_iseq + iseqw = RubyVM::InstructionSequence.compile('def a; a = :b; end') + base_obj_size = ObjectSpace.memsize_of(Object.new) + assert_operator(ObjectSpace.memsize_of(iseqw), :>, base_obj_size) + end + def test_reachable_objects_from assert_separately %w[--disable-gem -robjspace], __FILE__, __LINE__, <<-'eom' assert_equal(nil, ObjectSpace.reachable_objects_from(nil)) -- cgit v1.2.3