aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* debug.c: more enumsnobu2017-06-011-4/+4
| | | | | | | * 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
* attempt to fix rb_alloc_tmp_buffer2 for ALLOCV_Nnormal2017-05-261-1/+1
| | | | | | | | | | | | 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
* Merge Onigmo 6.1.2naruse2017-05-171-1/+1
| | | | | | 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
* Remove missing/strtol.crhe2017-04-211-6/+0
| | | | | | | 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
* Suppress a warning in ruby/win32.h [Fix GH-1591]nobu2017-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ruby.h: check argc to rb_funcallnobu2017-04-151-0/+11
| | | | | | | * 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
* fix RSTRUCT_LEN macro in public C APInormal2017-04-151-1/+1
| | | | | | | | | | | | 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
* ruby.h: check argc to rb_yield_valuesnobu2017-04-141-0/+34
| | | | | | | * 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
* thread.c: rb_thread_fd_close [ci skip]nobu2017-03-131-1/+1
| | | | | | | * 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
* thread.c: rb_thread_fd_close [ci skip]nobu2017-03-131-1/+1
| | | | | | | * 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
* revert RB_FIXABLE related changesets [Bug #13288][Bug #13293][Bug #13294]shyouhei2017-03-091-13/+2
| | | | | | | | | 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
* re-introduce __builtin_add_overflowshyouhei2017-03-081-16/+13
| | | | | | | | | | | | | 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
* Always use old RB_FIXABLE to allow double as argumentnaruse2017-03-071-5/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r57803 "Avoid to cast the argument"naruse2017-03-071-1/+1
| | | | | | __builtin_add_overflow doesn't support double. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Avoid to cast the argumentnaruse2017-03-071-1/+1
| | | | | | For 32bit environment and __int128 use cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use ADD instead of MULnaruse2017-03-071-12/+5
| | | | | | | | | | | | | | | | * 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
* optimize FIXABLE macroshyouhei2017-03-061-6/+31
| | | | | | | | | | | | 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
* broken mingwnobu2017-03-031-9/+9
| | | | | | | | | * 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
* backward.h: RClassDeprecatednobu2017-02-212-7/+8
| | | | | | | * 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
* backward.h: move deprecated declarationnobu2017-02-212-1/+3
| | | | | | | * 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
* variable.c: remove deprecated internal featurenobu2017-02-212-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c: remove deprecated internal featuresnobu2017-02-212-3/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c: remove deprecated functionsnobu2017-02-212-2/+4
| | | | | | | * 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
* backward.h: 2.2 deprecated featuresnobu2017-02-212-22/+20
| | | | | | | * 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
* ruby.h: remove commentnobu2017-02-131-1/+1
| | | | | | | * 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
* ruby.h: RB_GC_GUARD stronger than gcc7nobu2017-02-131-1/+5
| | | | | | | * 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
* Merge Onigmo 6.1.1naruse2017-02-111-5/+6
| | | | | | | * 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
* ruby.h: unused parameternobu2017-02-031-3/+3
| | | | | | | | * 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
* fix typo [Bug #13091]naruse2017-01-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/version.h: Update API version.matz2016-12-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* get rid of implicit signedness conversionsnobu2016-12-221-50/+54
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warning: implicit conversion changes signednessnaruse2016-12-221-2/+2
| | | | | | It causes [Bug #13060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: fix st_hash* functions [Bug #13019]nobu2016-12-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* declare `rb_w32_sysinit` in header.usa2016-12-131-0/+1
| | | | | | | | | | * 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
* Merge Onigmo 6.0.0naruse2016-12-102-876/+938
| | | | | | | | | | | * 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
* Suppress warning: this use of "defined" may not be portablenaruse2016-12-091-6/+9
| | | | | | | 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
* ruby.h: add prefixnobu2016-12-091-8/+10
| | | | | | | * 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
* switching hash removalnobu2016-12-061-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Revert changes on rb_frame_method_id_and_class()ktsj2016-12-041-1/+1
| | | | | | | 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
* use `rb_struct_ptr` for `RSTRUCT_PTR` macrousa2016-11-241-1/+1
| | | | | | | * 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
* ruby.h: rb_big_signnobu2016-11-191-3/+4
| | | | | | | * 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
* Introduce table improvement by Vladimir Makarov <vmakarov@redhat.com>.ko12016-11-071-30/+35
| | | | | | | | | | | | | | | | | | | | | | | [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
* * vm_trace.c (tracepoint_attr_callee_id, rb_tracearg_callee_id):ktsj2016-11-051-1/+1
| | | | | | | | | | | 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
* ruby/ruby.h: optimize rb_integer_type_pnobu2016-10-271-0/+12
| | | | | | | * 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
* ruby.h: use prefixed macronobu2016-10-261-1/+1
| | | | | | | * 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
* encoding.h: include ruby/ruby.hnobu2016-10-231-0/+1
| | | | | | | * 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
* Add prefix to FIX2LONG in include/ruby/ruby.hkazu2016-10-031-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: add prefixnobu2016-10-011-13/+15
| | | | | | | * 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
* gc.c: rb_gc_adjust_memory_usagenobu2016-09-201-0/+1
| | | | | | | * 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
* util.h: POSIX-noncompliant setenvnobu2016-09-071-4/+0
| | | | | | | * 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