aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
Commit message (Collapse)AuthorAgeFilesLines
* String#match? and Symbol#match?nobu2016-12-121-0/+1
| | | | | | | | * string.c (rb_str_match_m_p): inverse of Regexp#match?. based on the patch by Herwin Weststrate <herwin@snt.utwente.nl>. [Fix GH-1483] [Feature #12898] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: change the default rounding mode to half-upmrkn2016-12-101-1/+1
| | | | | | | | | | | | | * internal.h (ROUND_DEFAULT): changed to RUBY_NUM_ROUND_HALF_UP. [Bug #12958] [ruby-core:78204] * test/ruby/test_integer.rb: fix assertions for the above change. * test/ruby/test_rational.rb: ditto. * test/test_mathn.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* round-downnobu2016-11-251-4/+5
| | | | | | | * numeric.c (round_half_down, int_round_half_down): support round-down mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: optimize f_gt_p some casesmrkn2016-11-221-0/+3
| | | | | | | | | | | | | | * complex.c (f_gt_p): optimize f_gt_p for specific types of arguments. * internal.h (rb_int_gt, rb_float_gt, rb_rational_cmp): exported. * numeric.c (rb_float_gt): rename from flo_gt and be exported. * numeric.c (rb_int_gt): rename from int_gt and be exported. * rational.c (rb_rational_cmp): rename from nurat_cmp and be exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: optimize f_negatemrkn2016-11-181-0/+2
| | | | | | | | | | | | | | | | * complex.c (f_negate): optimize for special numeric types. * complex.c (nucomp_expt): use rb_int_uminus instead of f_negate for fixnum value. * internal.h (rb_float_uminus, rb_rational_uminus): exported. * numeric.c (rb_float_uminus): rename from flo_uminus. * rational.c (rb_rational_uminus): rename from nurat_negate, and add assertion for the parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: round macrosnobu2016-11-181-2/+8
| | | | | | | * internal.h (ROUND_FUNC, ROUND_CALL): macros wrapping round functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: optimize Numeric#polar and Numeric#argmrkn2016-11-161-0/+4
| | | | | | | | | | | | | | | | | | | * complex.c (numeric_polar): optimize for Integer, Float, and Rational. * complex.c (numeric_arg): directly create the value of pi. * complex.c (f_negative_p): optimize for Integer, Float, and Rational. * rational.c (INT_NEGATIVE_P): move the definition into internal.h. * internal.h (INT_NEGATIVE_P): ditto. * numeric.c (rb_float_abs): rename from flo_abs and export to be used from other source files.. * internal.h (rb_float_abs): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: optimize Integer#lcmmrkn2016-11-121-0/+2
| | | | | | | | | | | * rational.c (f_div, f_mul, f_abs): optimize Integer#lcm Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_int_abs): rename from int_abs to be exported. * internal.h (rb_int_div, rb_int_abs): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: optimize Float#to_rmrkn2016-11-121-0/+1
| | | | | | | | | | * rational.c (float_to_r): optimize Float#to_r. * numeric.c (rb_int_lshift): exported. * internal.h (rb_int_lshift): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: optimize Rational#{floor,ceil,round,truncate}mrkn2016-11-121-0/+2
| | | | | | | | | | | | | | * rational.c (f_{expt10,round_common},nurat_{floor,ceil,round_half_{up,even}}): optimize Rational#{floor,ceil,round,truncate}. Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_int_divmod): rename from int_divmod to be exported. * numeric.c (rb_int_and): rename from int_and to be exported. * intern.h (rb_int_{divmod,and}): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: purge f_cmpmrkn2016-11-121-0/+1
| | | | | | | | | | | | | * rational.c (f_cmp, nurat_expt): purge f_cmp. Author: Tadashi Saito <tad.a.digger@gmail.com> * rational.c (INT_POSITIVE_P): added. * numeric.c (FIXNUM_POSITIVE_P): move the definition into internal.h. * internal.h (FIXNUM_POSITIVE_P): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: optimize Rational#==mrkn2016-11-121-0/+1
| | | | | | | | | | | | * rational.c (nurat_eqeq_p): optimize Rational#==. Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_int_equal): rename from int_equal and remove static to be exported. * internal.h (rb_int_equal): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: optimize Rational#<=>mrkn2016-11-121-0/+1
| | | | | | | | | | | | * rational.c (nurat_cmp): optimize Rational#<=>. Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_int_cmp): rename from int_cmp and remove static to be exported. * internal.h (rb_int_cmp): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: optimize Rational#**mrkn2016-11-111-0/+2
| | | | | | | | | | | | * rational.c (nurat_expt): optimize Rational#**. Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_float_pow): rename flo_pow() to rb_float_pow() and remove static to be exporetd. * internal.h (rb_int_pow, rb_float_pow): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rational.c: avoid needless object allocation with nurat_to_doublemrkn2016-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * rational.c (nurat_to_double): introduce to convert rational to double without object allocation. * rational.c (rb_rational_plus, nurat_{sub,mul,to_f}): rewrite by using nurat_to_double. * bignum.c (rb_big_fdiv_double): introduce to calculate fdiv and return the result as a double value. * bignum.c (big_fdiv{,_int,_float}): change the return types for implementing rb_big_fdiv_double. * bignum.c (rb_big_fdiv): rewrite by using rb_big_fdiv_double. * numeric.c (rb_int_fdiv_double): introduce to calculate fdiv and return the result as a double value. * numeric.c (fix_fdiv_double): rewrite from fix_fdiv to return the result as a double value. * numeric.c (rb_int_fdiv): rewrite by using rb_int_fdiv_double. * internal.h (rb_{big,int}_fdiv_double): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c, rational.c: refactor by using FIXNUM_NEGATIVE_P and FIXNUM_ZERO_Pmrkn2016-11-111-0/+4
| | | | | | | | | | | * numeric.c (num_zero_p, fix_divide, fix_mod, fix_divmod): refactor by using FIXNUM_NEGATIVE_P and FIXNUM_ZERO_P. * rational.c (INT_NEGATIVE_P, INT_ZERO_P): ditto. * internal.h: move FIXNUM_NEGATIVE_P and FIXNUM_ZERO_P from numeric.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c, internal.h: export int_fdiv() as rb_int_fdiv()mrkn2016-11-101-0/+1
| | | | | | | | * numeric.c (rb_int_fdiv): export int_fdiv() as rb_int_fdiv(). * internal.h (rb_int_fdiv): add declaration of rb_int_fdiv(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce table improvement by Vladimir Makarov <vmakarov@redhat.com>.ko12016-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | [Feature #12142] See header of st.c for improvment details. You can see all of code history here: <https://github.com/vnmakarov/ruby/tree/hash_tables_with_open_addressing> This improvement is discussed at <https://bugs.ruby-lang.org/issues/12142> with many people, especially with Yura Sokolov. * st.c: improve st_table. * include/ruby/st.h: ditto. * internal.h, numeric.c, hash.c (rb_dbl_long_hash): extract a function. * ext/-test-/st/foreach/foreach.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: PATH env in spawnnobu2016-11-061-0/+1
| | | | | | | * process.c (rb_exec_fillarg): honor the given path environment variable. [ruby-core:53103] [Bug #8004] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: round to nearest evennobu2016-11-051-1/+13
| | | | | | | | | * numeric.c (flo_round, int_round): support round-to-nearest-even semantics of IEEE 754 to match sprintf behavior, and add `half:` optional keyword argument for the old behavior. [ruby-core:76273] [Bug #12548] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* chomp optionnobu2016-11-051-0/+1
| | | | | | | * io.c (extract_getline_opts): extract chomp option. [Feature #12553] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: RB_OBJ_BUILTIN_TYPEnobu2016-10-281-0/+18
| | | | | | | * internal.h (RB_OBJ_BUILTIN_TYPE): special-const safe BUILTIN_TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c: rb_undef_methods_fromnobu2016-10-241-0/+1
| | | | | | | * class.c (rb_undef_methods_from): undefine methods defined in super from klass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (ST2FIX): new macro to convert st_index_t to Fixnum.usa2016-10-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | a hash value of Object might be Bignum, but it causes many troubles expecially the Object is used as a key of a hash. so I've gave up to do so. * array.c (rb_ary_hash): use above macro. * bignum.c (rb_big_hash): ditto. * hash.c (rb_obj_hash, rb_hash_hash): ditto. * numeric.c (rb_dbl_hash): ditto. * proc.c (proc_hash): ditto. * re.c (rb_reg_hash, match_hash): ditto. * string.c (rb_str_hash_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (MAYBE_UNUSED): The fallback definition is needed.ngoto2016-09-161-0/+8
| | | | | | | | | | | Fix compile error with some non-GCC compilers such as Oracle Solaris Studio 12.3 on Solaris 10. [Bug #12767] [ruby-dev:49807] * internal.h (WARN_UNUSED_RESULT): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (WARN_UNUSED_RESULT): moved to configure.in, toshyouhei2016-09-161-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | actually check its availability rather to check GCC's version. * configure.in (WARN_UNUSED_RESULT): moved to here. * configure.in (RUBY_FUNC_ATTRIBUTE): change function declaration to return int rather than void, because it makes no sense for a warn_unused_result attributed function to return void. Funny thing however is that it also makes no sense for noreturn attributed function to return int. So there is a fundamental conflict between them. While I tested this, I confirmed both GCC 6 and Clang 3.8 prefers int over void to correctly detect necessary attributes under this setup. Maybe subject to change in future. * internal.h (UNINITIALIZED_VAR): renamed to MAYBE_UNUSED, then moved to configure.in for the same reason we move WARN_UNUSED_RESULT. * configure.in (MAYBE_UNUSED): moved to here. * internal.h (__has_attribute): deleted, because it has no use now. * string.c (rb_str_enumerate_lines): refactor macro rename. * string.c (rb_str_enumerate_bytes): ditto. * string.c (rb_str_enumerate_chars): ditto. * string.c (rb_str_enumerate_codepoints): ditto. * thread.c (do_select): ditto. * vm_backtrace.c (rb_debug_inspector_open): ditto. * vsnprintf.c (BSD_vfprintf): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: rb_deprecate_constantnobu2016-09-091-0/+1
| | | | | | | * variable.c (rb_deprecate_constant): new function to deprecate a constant by the name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: fix typosnobu2016-09-021-2/+2
| | | | | | | * internal.h (MEMO_V1_SET, MEMO_V2_SET): fix typos. use the macro parameter, not the local variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: fix r55831nobu2016-08-081-1/+1
| | | | | | | * internal.h (RBASIC_CLEAR_CLASS): fix compile error and size to fill. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (RBASIC_CLEAR_CLASS): Reroute ANSI C's strictshyouhei2016-08-081-2/+2
| | | | | | | | | aliasing rule. [ruby-core:74427][Bug #12191][ruby-core:76747][Bug #12657] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hide struct internal [Feature #9916]shyouhei2016-08-011-0/+51
| | | | | | | | | | | | | | * include/ruby/ruby.h (struct RStruct): no longer. * internal.h (struct RStruct): moved here. * struct.c (rb_struct_ptr): a compensation function for the lack of RSTRUCT_PTR. But now that we have RSTRUCT_GET/SET, that must not be used anyway. I mark this deprecated. Dont use it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, internal.h: remove RubyVM::Env class and all of env objectsko12016-07-281-8/+8
| | | | | | | | | | | | | | | | | | | | are imemo objects (imemo_env). * NEWS: describe this change. I believe nobody touch these objects because there are no method defined. * vm_core.h: remove the following definitions. * rb_cEnv decl. * GetEnvPtr() because Env is no longer T_DATA object. * vm_core.h (rb_env_t): fix layout for imemo values. * vm_core.h (vm_assert_env): added. * vm_core.h (vm_env_new): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: revisit the structure of frame, block and env.ko12016-07-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | [Bug #12628] This patch introduce many changes. * Introduce concept of "Block Handler (BH)" to represent passed blocks. * move rb_control_frame_t::flag to ep[0] (as a special local variable). This flags represents not only frame type, but also env flags such as escaped. * rename `rb_block_t` to `struct rb_block`. * Make Proc, Binding and RubyVM::Env objects wb-protected. Check [Bug #12628] for more details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: inline Check_Typenobu2016-07-231-0/+6
| | | | | | * internal.h (Check_Type): inline check for the object type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: rb_hash_add_new_elementnobu2016-07-201-0/+1
| | | | | | | | | * hash.c (rb_hash_add_new_element): add new element or do nothing if it is contained already. * array.c (ary_add_hash, ary_add_hash_by): use rb_hash_add_new_element. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c: Complex sqrtnobu2016-07-121-2/+2
| | | | | | | * math.c (rb_math_sqrt): [EXPERIMENTAL] move Complex sqrt support from mathn.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: rb_complex prefixnobu2016-07-121-2/+2
| | | | | | | * complex.c (rb_complex_plus, rb_complex_mul): rename to rb_complex prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_change_terminator_length): New function to changengoto2016-07-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | termlen and resize heap for the terminator. This is split from rb_str_fill_terminator (str_fill_term) because filling terminator and changing terminator length are different things. [Bug #12536] * internal.h: declaration for rb_str_change_terminator_length. * string.c (str_fill_term): Simplify only to zero-fill the terminator. For non-shared strings, it assumes that (capa + termlen) bytes of heap is allocated. This partially reverts r55557. * encoding.c (rb_enc_associate_index): rb_str_change_terminator_length is used, and it should be called whenever the termlen is changed. * string.c (str_capacity): New static function to return capacity of a string with the given termlen, because the termlen may sometimes be different from TERM_LEN(str) especially during changing termlen or filling terminator with specific termlen. * string.c (rb_str_capacity): Use str_capacity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Integer unification macronobu2016-06-131-0/+5
| | | | | | | | | | | * include/ruby/ruby.h (RUBY_INTEGER_UNIFICATION): macro to tell if Integer is integrated. [ruby-core:75718][Bug #12427] * include/ruby/backward.h, internal.h (rb_cFixnum, rb_cBignum): fallback to rb_cInteger. * bignum.c, numeric.c, ext/json/generator/generator.{c,h}: use the macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c: ensure NUL-terminated for ENVnobu2016-06-101-1/+1
| | | | | | | | | * hash.c (get_env_cstr): ensure NUL-terminated. [ruby-dev:49655] [Bug #12475] * string.c (rb_str_fill_terminator): return the pointer to the NUL-terminated content. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: Remove excess semicolons in PUREFUNC().ngoto2016-06-081-1/+1
| | | | | | | | | Fix failure of TestMkmf::TestConvertible on Solaris with Oracle Solaris Studio 12. [ruby-dev:49651] [Bug #12470] * internal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* transcode.c: scrub in the given encodingnobu2016-05-271-0/+1
| | | | | | | | * transcode.c (str_transcode0): scrub in the given encoding when the source encoding is given, not in the encoding of the receiver. [ruby-core:75732] [Bug #12431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use RB_GNUC_EXTENSION_BLOCK instead of __extension__ngoto2016-05-201-8/+6
| | | | | | | | | | | | | | | | | | | * include/ruby/defines.h (RB_GNUC_EXTENSION, RB_GNUC_EXTENSION_BLOCK): macros for skipping __extension__ on non-GCC compilers. * eval_error.c (warn_print): use RB_GNUC_EXTENSION_BLOCK instead of __extension__ because __extension__ is a GNU extension. Fix compile error on Solaris 10 with Oracle Solaris Studio 12.x. [Bug #12397] [ruby-dev:49629]. * internal.h (rb_fstring_cstr, rb_fstring_enc_cstr): ditto * include/ruby/encoding.h (rb_enc_str_new, rb_enc_str_new_cstr): ditto * include/ruby/intern.h (rb_str_new, rb_str_new_cstr, rb_usascii_str_new, rb_utf8_str_new, rb_tainted_str_new_cstr, rb_usascii_str_new_cstr, rb_utf8_str_new_cstr, rb_external_str_new_cstr, rb_locale_str_new_cstr, rb_str_buf_new_cstr, rb_str_cat_cstr, rb_exc_new_cstr): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* exclude non-VALUE in memo from GCnobu2016-05-201-0/+6
| | | | | | | | | | | * internal.h (NEW_PARTIAL_MEMO_FOR): shrink buffer array not to mark non-VALUE fields. fix check_rvalue_consistency abort with RGENGC_CHECK_MODE=2. * internal.h (NEW_CMP_OPT_MEMO): exclude struct cmp_opt_data from the valid array range. * enum.c (slicewhen_i): exclude inverted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Optimize enum_sum for a range from int to intmrkn2016-05-171-0/+1
| | | | | | | | | | | | | * enum.c (enum_sum): Optimize for a range from int to int. * test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb, and add assertions for some conditions. * test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb. * test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/defines.h (GCC_VERSION_SINCE): moved from internal.hnaruse2016-05-121-7/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use HAVE_BUILTIN___BUILTIN_CONSTANT_Pnaruse2016-05-121-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configurein: use alternative keywordnaruse2016-05-121-5/+5
| | | | | | to avoid macros conflicts with them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check function attirbute const and pure,naruse2016-05-081-13/+16
| | | | | | | | | | | | and define CONSTFUNC and PUREFUNC if available. Note that I don't add those options as default because it still shows many false-positive (it seems not to consider longjmp). * vm_eval.c (stack_check): get rb_thread_t* as an argument to avoid duplicate call of GET_THREAD(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: Remove prototype declarations to internal.hyui-knk2016-05-041-0/+4
| | | | | | | | | | | | | * numeric.c (fix_plus): Remove rb_nucomp_add prototype declaration. * numeric.c (fix_mul): Remove rb_nucomp_mul prototype declaration. * internal.h (rb_nucomp_add, rb_nucomp_mul): add prototype declarations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e