diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-03 12:24:49 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-03 12:24:49 +0000 |
commit | 38caab29bc759be2694013fc3930116e64fcc1d4 (patch) | |
tree | 89a5f0f5822ff8fa83edda4d64ee29c17ae4aa65 | |
parent | 728afecc5549dec604e2ad9933ed99154e47c491 (diff) | |
download | ruby-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
-rw-r--r-- | object.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |