[前][次][番号順一覧][スレッド一覧]

ruby-changes:28631

From: nobu <ko1@a...>
Date: Mon, 13 May 2013 14:53:39 +0900 (JST)
Subject: [ruby-changes:28631] nobu:r40683 (trunk): vm_method.c: rb_method_entry_at

nobu	2013-05-13 14:51:14 +0900 (Mon, 13 May 2013)

  New Revision: 40683

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40683

  Log:
    vm_method.c: rb_method_entry_at
    
    * vm_method.c (rb_method_entry_at): return the method entry for id at
      klass, without ancestors.

  Modified files:
    trunk/ChangeLog
    trunk/method.h
    trunk/vm_method.c

Index: method.h
===================================================================
--- method.h	(revision 40682)
+++ method.h	(revision 40683)
@@ -110,6 +110,7 @@ struct unlinked_method_entry_list_entry https://github.com/ruby/ruby/blob/trunk/method.h#L110
 void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
 rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);
 rb_method_entry_t *rb_method_entry(VALUE klass, ID id, VALUE *define_class_ptr);
+rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
 void rb_add_refined_method_entry(VALUE refined_class, ID mid);
 rb_method_entry_t *rb_resolve_refined_method(VALUE refinements,
 					     rb_method_entry_t *me,
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40682)
+++ ChangeLog	(revision 40683)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Mon May 13 14:50:35 2013  Nobuyoshi Nakada  <nobu@r...>
+Mon May 13 14:51:12 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_method.c (rb_method_entry_at): return the method entry for id at
+	  klass, without ancestors.
 
 	* class.c (rb_singleton_class_get): get the singleton class if exists,
 	  or nil.
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 40682)
+++ vm_method.c	(revision 40683)
@@ -510,6 +510,12 @@ search_method(VALUE klass, ID id, VALUE https://github.com/ruby/ruby/blob/trunk/vm_method.c#L510
     return me;
 }
 
+rb_method_entry_t *
+rb_method_entry_at(VALUE klass, ID id)
+{
+    return lookup_method_table(klass, id);
+}
+
 /*
  * search method entry without the method cache.
  *

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]