From 38caab29bc759be2694013fc3930116e64fcc1d4 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Sat, 3 Nov 2018 12:24:49 +0000 Subject: [PATCH] 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/object.c b/object.c index cc1c75e639..14efb86434 100644 --- a/object.c +++ b/object.c @@ -3055,7 +3055,8 @@ rb_check_convert_type_with_id(VALUE val, int type, const char *tname, ID method) #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;