aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-03 12:24:49 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-03 12:24:49 +0000
commit38caab29bc759be2694013fc3930116e64fcc1d4 (patch)
tree89a5f0f5822ff8fa83edda4d64ee29c17ae4aa65 /object.c
parent728afecc5549dec604e2ad9933ed99154e47c491 (diff)
downloadruby-38caab29bc759be2694013fc3930116e64fcc1d4.tar.gz
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@methodmissing.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 2 insertions, 1 deletions
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;