summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2017-06-01debug.c: more enumsnobu
* debug.c (ruby_dummy_gdb_enums): add enums for RObject, RModule, RString, RArray. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26attempt to fix rb_alloc_tmp_buffer2 for ALLOCV_Nnormal
This is a confusing function to my arithmetic-challenged mind, but nobu seems alright with this. Anyways this lets me use large values of elsize without segfaulting, and "make exam" passes. * include/ruby/ruby.h (rb_alloc_tmp_buffer2): attempt to fix [ruby-core:81388] [ruby-core:81391] [Bug #13595] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17Merge Onigmo 6.1.2naruse
https://github.com/k-takata/Onigmo/commit/1364ae3488cac0acbf2d61ef3ce2b62fe0c0f528 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21Remove missing/strtol.crhe
It is never used. We don't need it anyway as it's part of C89 which is our current minimum requirement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21Suppress a warning in ruby/win32.h [Fix GH-1591]nobu
Fix a warning in ruby/win32.h which can cause failures with mkmf The return value is implicit type casted from 'long double' to 'double', currently. This causes a gcc warning like this: ``` In file included from C:\Ruby24-x64\include\ruby-2.4.0/ruby/defines.h:243:0, from C:\Ruby24-x64\include\ruby-2.4.0/ruby/ruby.h:36, from C:\Ruby24-x64\include\ruby-2.4.0/ruby.h:33, from conftest.c:1: C:\Ruby24-x64\include\ruby-2.4.0/ruby/win32.h: In function 'rb_w32_pow': C:\Ruby24-x64\include\ruby-2.4.0/ruby/win32.h:786:12: warning: conversion to 'double' from 'long double' may alter its value [-Wfloat-conversion] return powl(x, y); ^~~~~~~~~~ ``` This is fixed by the attached explicit type cast. Moreover when CFLAGS is set to '-Wconversion', it prevents the compiler from building. This is the case at the nokogiri gem. The original issue arose at RubyInstaller2: https://github.com/oneclick/rubyinstaller2/commit/576a0eb70aa9348b366c3ecfe83c67811b7bcb9b git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-15ruby.h: check argc to rb_funcallnobu
* include/ruby/ruby.h (rb_funcall): check if argc matches the number of variadic arguments, and replace with rb_funcallv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-15fix RSTRUCT_LEN macro in public C APInormal
rb_struct_size returns an Integer VALUE, so it must be converted to a `long` for compatibility with previous Ruby C API versions. * ext/-test-/struct/len.c: new * test/-ext-/struct/test_len.rb: new * include/ruby/ruby.h (RSTRUCT_LEN): use NUM2LONG [ruby-core:80692] [Bug #13439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-14ruby.h: check argc to rb_yield_valuesnobu
* include/ruby/ruby.h (rb_yield_values): check if argc matches the number of variadic arguments, and replace with rb_yield_values2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13thread.c: rb_thread_fd_close [ci skip]nobu
* thread.c (rb_thread_fd_close): remove deprecated. a couple of external libraries used it. [ruby-core:80078] [Bug #13304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13thread.c: rb_thread_fd_close [ci skip]nobu
* thread.c (rb_thread_fd_close): re-define only for abi-check, abort if called. [ruby-core:80078] [Bug #13304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-09revert RB_FIXABLE related changesets [Bug #13288][Bug #13293][Bug #13294]shyouhei
This commit is auto-generated using following command: svn diff -r57807:57788 include internal.h bignum.c numeric.c compile.c insns.def object.c sprintf.c | patch -p0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-08re-introduce __builtin_add_overflowshyouhei
r57789 (74cdd89) was gradually "improve"d by naruse through r57793 to r57806, resulted in reverting the efect of r57789 while retaining its complexity. I think the current situation is slightly worse than before (same output complicated source code). Here I introduce __builtin_add_overflow again, which (I think) is what naruse wanted to do in r57793. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07Always use old RB_FIXABLE to allow double as argumentnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07Revert r57803 "Avoid to cast the argument"naruse
__builtin_add_overflow doesn't support double. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07Avoid to cast the argumentnaruse
For 32bit environment and __int128 use cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07Use ADD instead of MULnaruse
* On recent CPUs, 2-operand MUL's latency is 3 cycle but ADD is 1 cycle. * clang Optimizes `MUL rax,2` into `ADD rax,rax` but gcc7 doesn't. * LONG2FIX is compiled into `lea r14,[r15+r15*1+0x1]`; this is 1cycle and run in parallel if the branch prediction is correct. * Note that old (RB_POSFIXABLE(f) && RB_NEGFIXABLE(f)) is usually uses following instructions. * movabs rax,0x4000000000000000 * add rax,rdi * js It needs large immediate and Macro-Fusion is not applied. ADD and JO is much smaller though it is also Macro-Fusion unfriendly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-06optimize FIXABLE macroshyouhei
Looking at the source code, FIXABLE tends to be just before LOING2FIX to check applicability of that operation. Why not try computing first then check for overflow, which should be optimial. I also tried the same thing for unsigned types but resulted in slower execution. It seems RB_POSFIXABLE() is fast enough on modern CPUs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-03broken mingwnobu
* configure.in: check whether frexp and modf are broken. * include/ruby/win32.h (frexp, modf): ignore bad declarations when compiling as C++. [ruby-core:79859] [Bug #13267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21backward.h: RClassDeprecatednobu
* include/ruby/backward.h (RClassDeprecated): move from ruby/ruby.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21backward.h: move deprecated declarationnobu
* include/ruby/backward.h (rb_autoload): move declaration of deprecated function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21variable.c: remove deprecated internal featurenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21error.c: remove deprecated internal featuresnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21complex.c: remove deprecated functionsnobu
* complex.c (rb_complex_set_real, rb_complex_set_imag): remove functions deprecated at 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-21backward.h: 2.2 deprecated featuresnobu
* include/ruby/backward.h (DECLARE_DEPRECATED_FEATURE): move features deprecated at 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-13ruby.h: remove commentnobu
* include/ruby/ruby.h (RB_GC_GUARD): remove comment unsupported by Solaris AS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-13ruby.h: RB_GC_GUARD stronger than gcc7nobu
* include/ruby/ruby.h (RB_GC_GUARD): prevent guarded pointer from optimization by using as an input to inline asm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-11Merge Onigmo 6.1.1naruse
* Support absent operator https://github.com/k-takata/Onigmo/issues/82 * https://github.com/k-takata/Onigmo/blob/Onigmo-6.1.1/HISTORY git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-03ruby.h: unused parameternobu
* include/ruby/ruby.h (rb_scan_args_set): remove unused parameter for more pedantic extension libraries. [ruby-core:79399] [Feature #13184] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-01fix typo [Bug #13091]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-25include/ruby/version.h: Update API version.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-22get rid of implicit signedness conversionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-22suppress warning: implicit conversion changes signednessnaruse
It causes [Bug #13060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-21st.c: fix st_hash* functions [Bug #13019]nobu
Previous implementation had an issues: - macros murmur1 assumes murmur_step takes rotation value as a second argument - but murmur_step second argument is "next block" - this makes st_hash_uint and st_hash_end to not mix high bits of hash value into lower bits - this leads to pure hash behavior on doubles and mixing hashes using st_hash_uint. It didn't matter when bins amount were prime numbers, but it hurts when bins are powers of two. Mistake were created cause of attempt to co-exist Murmur1 and Murmur2 in a same code. Change it to single hash-function implementation. - block function is in a spirit of Murmur functions, but handles inter-block dependency a bit better (imho). - final block is read in bit more optimal way on CPU with unaligned word access, - final block is mixed in simple way, - finalizer is taken from MurmurHash3 (it makes most of magic :) ) (64bit finalizer is taken from http://zimbry.blogspot.ru/2011/09/better-bit-mixing-improving-on.html) Also remove ST_USE_FNV1: it lacks implementation of many functions, and looks to be abandoned Author: Sokolov Yura aka funny_falcon <funny.falcon@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-13declare `rb_w32_sysinit` in header.usa
* include/ruby/win32.h (rb_w32_sysinit): declare. [ruby-core:78444] [Bug #12994] * ruby.c (ruby_sysinit): follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-10Merge Onigmo 6.0.0naruse
* https://github.com/k-takata/Onigmo/blob/Onigmo-6.0.0/HISTORY * fix for ruby 2.4: https://github.com/k-takata/Onigmo/pull/78 * suppress warning: https://github.com/k-takata/Onigmo/pull/79 * include/ruby/oniguruma.h: include onigmo.h. * template/encdb.h.tmpl: ignore duplicated definition of EUC-CN in enc/euc_kr.c. It is defined in enc/gb2313.c with CRuby macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-09Suppress warning: this use of "defined" may not be portablenaruse
Use of defined() in macro expansion is considered non portable. https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01577.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-09ruby.h: add prefixnobu
* include/ruby/ruby.h (RB_TEST, RB_NIL_P): prefix RB to get rid of name conflicts with other headers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-06switching hash removalnobu
* st.h (struct st_hash_type): Remove strong_hash. (struct st_table): Remove inside_rebuild_p and curr_hash. * st.c (do_hash): Use type->hash instead of curr_hash. (make_tab_empty): Remove setting up curr_hash. (st_init_table_with_size): Remove setting up inside_rebuild_p. (rebuild_table): Remove clearing inside_rebuild_p. (reset_entry_hashes, HIT_THRESHOULD_FOR_STRONG_HASH): Remove code recognizing a denial attack and switching to strong hash. * hash.c (rb_dbl_long_hash, rb_objid_hash, rb_ident_hash): Use rb_hash_start to randomize the hash. (str_seed): Remove. (any_hash): Remove strong_p and use always rb_str_hash for strings. (any_hash_weak, rb_any_hash_weak): Remove. (st_hash_type objhash): Remove rb_any_hash_weak. based on the patch by Vladimir N Makarov <vmakarov@redhat.com> at [ruby-core:78490]. [Bug #13002] * test/ruby/test_hash.rb (test_wrapper): objects other than special constants should be able to be wrapped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04Revert changes on rb_frame_method_id_and_class()ktsj
r56593 introduced backwards incompatible changes in the API. [ruby-core:78471] [Feature #12747] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-24use `rb_struct_ptr` for `RSTRUCT_PTR` macrousa
* include/ruby/ruby.h (RSTRUCT_PTR): at r55788, `rb_struct_const_ptr` had been hidden and `rb_struct_ptr` had been implemented for backward compatiblity. but the definition of `RSTRUCT_PTR` was not modified to use it, probably by mistake. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19ruby.h: rb_big_signnobu
* include/ruby/ruby.h (RBIGNUM_SIGN): use a wrapper function to return the sign bit, instead of comparing with 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-07 Introduce table improvement by Vladimir Makarov <vmakarov@redhat.com>.ko1
[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
2016-11-05* vm_trace.c (tracepoint_attr_callee_id, rb_tracearg_callee_id):ktsj
add TracePoint#callee_id. [ruby-core:77241] [Feature #12747] * cont.c, eval.c, gc.c, include/ruby/intern.h, insns.def, thread.c, vm.c, vm_backtrace.c, vm_core.h, vm_eval.c, vm_insnhelper.c, vm_trace.c: ditto. * test/ruby/test_settracefunc.rb: tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-27ruby/ruby.h: optimize rb_integer_type_pnobu
* include/ruby/ruby.h (rb_integer_type_p): turn into macro to help clang based on old gcc to eliminate CSE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-26ruby.h: use prefixed macronobu
* include/ruby/ruby.h (rb_intern): use prefixed version macro RUBY_CONST_ID_CACHE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-23encoding.h: include ruby/ruby.hnobu
* include/ruby/encoding.h: include "ruby/ruby.h" explicitly for enum ruby_fl_type and VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-03Add prefix to FIX2LONG in include/ruby/ruby.hkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-01ruby.h: add prefixnobu
* include/ruby/ruby.h (RB_INT2FIX, RB_LONG2FIX): prefix RB to global symbols to get rid of name conflicts with other headers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-20gc.c: rb_gc_adjust_memory_usagenobu
* gc.c (rb_gc_adjust_memory_usage): notify memory usage to the GC engine by extension libraries, to trigger GC. [Feature #12690] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-07util.h: POSIX-noncompliant setenvnobu
* include/ruby/util.h (setenv): remove POSIX-noncompliant definition with 2 arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e