ruby-changes:36037
From: nobu <ko1@a...>
Date: Fri, 24 Oct 2014 01:03:03 +0900 (JST)
Subject: [ruby-changes:36037] nobu:r48118 (trunk): vm_method.c: get rid of cache
nobu 2014-10-24 01:02:46 +0900 (Fri, 24 Oct 2014) New Revision: 48118 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48118 Log: vm_method.c: get rid of cache * vm_method.c (rb_method_entry_make): get rid of storing method cache, so that the added method will be called later. [ruby-dev:48691] [Bug #10421] Modified files: trunk/vm_method.c Index: vm_method.c =================================================================== --- vm_method.c (revision 48117) +++ vm_method.c (revision 48118) @@ -199,6 +199,7 @@ rb_free_method_entry(rb_method_entry_t * https://github.com/ruby/ruby/blob/trunk/vm_method.c#L199 xfree(me); } +static inline rb_method_entry_t *search_method(VALUE klass, ID id, VALUE *defined_class_ptr); static int rb_method_definition_eq(const rb_method_definition_t *d1, const rb_method_definition_t *d2); static inline rb_method_entry_t * @@ -379,7 +380,7 @@ rb_method_entry_make(VALUE klass, ID mid https://github.com/ruby/ruby/blob/trunk/vm_method.c#L380 } /* check mid */ if (mid == object_id || mid == id__send__) { - if (type == VM_METHOD_TYPE_ISEQ && rb_method_boundp(klass, mid, 0)) { + if (type == VM_METHOD_TYPE_ISEQ && search_method(klass, mid, 0)) { rb_warn("redefining `%s' may cause serious problems", rb_id2name(mid)); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/