ruby-changes:53300
From: k0kubun <ko1@a...>
Date: Sat, 3 Nov 2018 21:24:55 +0900 (JST)
Subject: [ruby-changes:53300] k0kubun:r65516 (trunk): Always inline rb_to_integer to prevent a method call penalty
k0kubun 2018-11-03 21:24:49 +0900 (Sat, 03 Nov 2018) New Revision: 65516 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65516 Log: Always inline rb_to_integer to prevent a method call penalty for integer types Close https://github.com/ruby/ruby/pull/2001 Co-Authored-By: methodmissing <lourens@m...> Modified files: trunk/object.c Index: object.c =================================================================== --- object.c (revision 65515) +++ object.c (revision 65516) @@ -3055,7 +3055,8 @@ rb_check_convert_type_with_id(VALUE val, https://github.com/ruby/ruby/blob/trunk/object.c#L3055 #define try_to_int(val, mid, raise) \ convert_type_with_id(val, "Integer", mid, raise, -1) -static VALUE +ALWAYS_INLINE(static VALUE rb_to_integer(VALUE val, const char *method, ID mid)); +static inline VALUE rb_to_integer(VALUE val, const char *method, ID mid) { VALUE v; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/