ruby-changes:54854
From: ko1 <ko1@a...>
Date: Wed, 13 Feb 2019 13:25:07 +0900 (JST)
Subject: [ruby-changes:54854] ko1:r67058 (trunk): fix imemo entry description.
ko1 2019-02-13 13:24:59 +0900 (Wed, 13 Feb 2019) New Revision: 67058 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67058 Log: fix imemo entry description. * ext/objspace/objspace.c (count_imemo_objects): `imemo_type_ids` should be match with `enum imemo_type` in internal.h and this patch fix mismatch. Modified files: trunk/ext/objspace/objspace.c trunk/test/objspace/test_objspace.rb Index: ext/objspace/objspace.c =================================================================== --- ext/objspace/objspace.c (revision 67057) +++ ext/objspace/objspace.c (revision 67058) @@ -618,7 +618,7 @@ count_imemo_objects(int argc, VALUE *arg https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace.c#L618 VALUE hash = setup_hash(argc, argv); if (imemo_type_ids[0] == 0) { - imemo_type_ids[0] = rb_intern("imemo_none"); + imemo_type_ids[0] = rb_intern("imemo_env"); imemo_type_ids[1] = rb_intern("imemo_cref"); imemo_type_ids[2] = rb_intern("imemo_svar"); imemo_type_ids[3] = rb_intern("imemo_throw_data"); @@ -627,7 +627,8 @@ count_imemo_objects(int argc, VALUE *arg https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace.c#L627 imemo_type_ids[6] = rb_intern("imemo_ment"); imemo_type_ids[7] = rb_intern("imemo_iseq"); imemo_type_ids[8] = rb_intern("imemo_tmpbuf"); - imemo_type_ids[9] = rb_intern("imemo_parser_strterm"); + imemo_type_ids[9] = rb_intern("imemo_ast"); + imemo_type_ids[10] = rb_intern("imemo_parser_strterm"); } rb_objspace_each_objects(count_imemo_objects_i, (void *)hash); Index: test/objspace/test_objspace.rb =================================================================== --- test/objspace/test_objspace.rb (revision 67057) +++ test/objspace/test_objspace.rb (revision 67058) @@ -98,6 +98,8 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L98 res = ObjectSpace.count_imemo_objects assert_not_empty(res) assert_not_nil(res[:imemo_cref]) + assert_not_empty res.inspect + arg = {} res = ObjectSpace.count_imemo_objects(arg) assert_not_empty(res) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/