diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-02 04:20:30 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-02 04:20:30 +0000 |
commit | dc61ecce09ac75e0dcc336b31b4deb544d3598b1 (patch) | |
tree | 4eb5c4ef7ac97b4da216c22bcc1defa67942388f /internal.h | |
parent | bfb7e27fe2b73e054d0382990ceef7189de71d28 (diff) | |
download | ruby-dc61ecce09ac75e0dcc336b31b4deb544d3598b1.tar.gz |
* method.h: make rb_method_entry_t a VALUE.
Motivation and new data structure are described in [Bug #11203].
This patch also solve the following issues.
* [Bug #11200] Memory leak of method entries
* [Bug #11046] __callee__ returns incorrect method name in orphan
proc
* test/ruby/test_method.rb: add a test for [Bug #11046].
* vm_core.h: remvoe rb_control_frame_t::me. me is located at value
stack.
* vm_core.h, gc.c, vm_method.c: remove unlinked_method... codes
because method entries are simple VALUEs.
* method.h: Now, all method entries has own independent method
definititons. Strictly speaking, this change is not essential,
but for future changes.
* rb_method_entry_t::flag is move to rb_method_definition_t::flag.
* rb_method_definition_t::alias_count is now
rb_method_definition_t::alias_count_ptr, a pointer to the counter.
* vm_core.h, vm_insnhelper.c (rb_vm_frame_method_entry) added to
search the current method entry from value stack.
* vm_insnhelper.c (VM_CHECK_MODE): introduced to enable/disable
assertions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal.h b/internal.h index 64896e0ff9..d9cc93f9e6 100644 --- a/internal.h +++ b/internal.h @@ -535,6 +535,7 @@ enum imemo_type { imemo_throw_data = 3, imemo_ifunc = 4, imemo_memo = 5, + imemo_ment = 6, imemo_mask = 0x07 }; @@ -558,7 +559,7 @@ typedef struct rb_cref_struct { struct vm_svar { VALUE flags; - const rb_cref_t * const cref; + const VALUE cref_or_me; const VALUE lastline; const VALUE backref; const VALUE others; @@ -615,6 +616,8 @@ struct MEMO { #define NEW_MEMO_FOR(type, value) \ ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value)) +/* ment is in method.h */ + /* global variable */ struct rb_global_entry { |