summaryrefslogtreecommitdiff
path: root/include/ruby
AgeCommit message (Collapse)Author
2018-01-15also blacklist gcc 4.9 for __builtin_alloca_with_alignshyouhei
Reports show that gcc (Raspbian 4.9.2-10) 4.9.2 fails here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15disable __builtin_alloca_with_align for GCC 4.8shyouhei
It seems to be a false positive that the configure detects this undocumented function to be available on the compiler. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15give up RSTRING_PTR() being VALUE-alignedshyouhei
rb_setup_fake_str() can take arbitrary char* address, typicalluy C string literals. These arguments have no guarantee of alignment at all. It was not a wise idea for me to think RSTRING_PTR can be aligned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15__declspec(align(#)) does not take sizeof()shyouhei
Use compile-time constant expression instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15more support for NORETURNshyouhei
Before this NORETURN was checked only for __attribute__ or __declspec, but nowadays other ways are there to tell compilers that a function never returns. Take them into account. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15__builtin_alloca_with_align for optimal memory accessshyouhei
ALLOCA_N takes type arugment. It is natural that the returned value to be used as an array of type, thus type-aligned. Luckily GCC has a builtin to tell compiler such alignment info. This should generate beter instructions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15__alignof__ to take alignment of a typeshyouhei
C11 and C++11 has this feature so why not use it when available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15__attibute__((__aligned__)) for RSTRING_PTR()shyouhei
For instance array.c:rb_ary_product() uses RSTRING_PTR() as an array of int. So to avoid misaligned memory access RSTRING_PTR() must at least be sizeof(int)-aligned. However the type of RSTRING_PTR() is char*, which of course can expect alignment as much as 1. This is a problem. The reality is, there is no misaligned memory access because the memory region behind RSTRING_PTR() is allocated using malloc(). Memory regions returned from malloc() are always aligned appropriately. So let's tell the compiler about this information. It seems GCC, clang, and MSVC have such feature. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09Include ruby/{io,encoding}.h before internal.hkazu
because of r61712 and r61713 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09wrap statement expression with __extension__nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02statement experssion is a GCCismshyouhei
should mark as such. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02__VA_ARGS__ is a C99ismshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-25version.h (RUBY_VERSION): 2.6.0 development has started.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-23undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P on GCC 4.8naruse
GCC 4.8 with optimization causes error if it compiles following code. [Bug #14221] ```c __builtin_choose_expr(__builtin_constant_p(b),0,1) ``` https://github.com/ruby/ruby/pull/1778 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22force hash values fixableusa
* include/ruby/ruby.h (RB_ST2FIX): force fixable on LLP64 environment. * hash.c (any_hash): ditto. [ruby-core:84395] [Bug #14218] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20compile.c: add a RUBY_EVENT_COVERAGE_LINE event for line coveragemame
2.5's line coverage measurement was about two times slower than 2.4 because of two reasons; (1) vm_trace uses rb_iseq_event_flags (which takes O(n) currently where n is the length of iseq) to get an event type, and (2) RUBY_EVENT_LINE uses setjmp to call an event hook. This change adds a special event for line coverage, RUBY_EVENT_COVERAGE_LINE, and adds `tracecoverage` instructions where the event occurs in iseq. `tracecoverage` instruction calls an event hook without vm_trace. And, RUBY_EVENT_COVERAGE_LINE is an internal event which does not use setjmp. This change also cancells lineno change due to the deletion of trace instructions [Feature #14104]. So fixes [Bug #14191]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-18suppress warning: 'const' attribute on function returning 'void'naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add FrozenError as a subclass of RuntimeErrorshyouhei
FrozenError will be used instead of RuntimeError for exceptions raised when there is an attempt to modify a frozen object. The reason for this change is to differentiate exceptions related to frozen objects from generic exceptions such as those generated by Kernel#raise without an exception class. From: Jeremy Evans <code@jeremyevans.net> Signed-off-by: Urabe Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11undef previous definition of `SIZEOF_STRUCT_STAT_ST_INO`usa
trying to solve build problem of MinGW. see [Bug #14165] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-11extern rb_time_utc_offset to get utc offsetnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-10support 128bit ino on Windows (if available)usa
* win32/win32.c, include/ruby/win32.h (stati128, rb_{,u,l,ul}stati128): rename from stati64ns, change the type of st_ino to 64bit and added st_inohigh. * dir.c, file.c (stat, lstat): follow above changes. * file.c (rb_stat_ino): support 128bit ino. * win32/win32.c (rb_{,u,l,ul}stati128): ditto. [Feature #13731] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06vm_core.h (RUBY_EVENT_COVERAGE_BRANCH): renamedmame
This change moves RUBY_EVENT_COVERAGE from include/ruby/ruby.h to vm_core.h and renames it to RUBY_EVENT_COVERAGE_BRANCH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06Remove RUBY_EVENT_SPECIFIED_LINEmame
Follow up of r61044 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04support nanosec file timestamp on newer Windowsusa
Support nanosec file timestamp on Windows 8 or later. Original patches are written by kubo (Kubo Takehiro). Windows 7 and earlier also supports nanosec file timestamp, but it's too accurate than system time. so, this feature is disabled on such versions. [Feature #13726] this change also includes [Misc #13702] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05.naruse
[Bug #13892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01vm.c: partially revert r60558k0kubun
because it was actually used in https://github.com/tmm1/rbtrace/blob/v0.4.8/ext/rbtrace.c#L329 and deprecated in r60579 AFTER removal in r60558. ko1 agreed that we should keep just deprecated in Ruby 2.5 and remove it later, and I'm commiting this because I want to make rbtrace.gem installation successful. backward.h: modify r60579 to make rb_frame_method_id_and_class() compilable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-26util.h: remove my_getcwdnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-16export rb_tracearg_callee_id().ko1
* include/ruby/debug.h (rb_tracearg_callee_id): export. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30backward.h: rb_frame_method_id_and_classnobu
* include/ruby/backward.h (rb_frame_method_id_and_class): moved a deprecated declaration from intern.h, for r60558. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Add doxygen commentssonots
* include/ruby/ruby.h (enum ruby_value_type): add doxygen comments * internal.h (enum imemo_type, struct vm_svar): add doxygen comments * method.h (rb_method_type_t, rb_method_iseq_t): add doxygen comments git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-13defines.h: warn EXTERNnobu
* include/ruby/defines.h (EXTERN): warn as deprecated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-07ruby.h: unnormalized Fixnum valuenobu
* include/ruby/ruby.h (ST2FIX): fix unnormalized Fixnum value bug on mingw/mswin. [ruby-core:82687] [Bug #13877] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-20non-keywords hashnobu
* class.c (rb_scan_args), include/ruby/ruby.h (rb_scan_args_set): return non-keywords elements only in the last hash when keyword arguments are extracted from it, as well as methods defined in ruby level. [ruby-core:82427] [Bug #13830] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-19ruby.h: fix rb_scan_args_trail_idxnobu
* include/ruby/ruby.h (rb_scan_args_trail_idx): fix the case both of optional and rest arguments are defined. [ruby-core:82427] [Bug #13830] * include/ruby/ruby.h (rb_scan_args_n_trail): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-03ruby.h: NULL as empty arraynobu
* include/ruby/ruby.h (rb_yield_values, rb_funcall): call with NULL when no arguments, for clang which defines static array when an empty array is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-01should not copy promoted flags.ko1
* include/ruby/ruby.h (rb_clone_setup): should not copy some flags (FL_PROMOTED0|FL_PROMOTED1|FL_FINALIZE). [Bug #13775] * test/ruby/test_object.rb: add a test (note that this test will fail only when RGENGC_CHECK_MODE >= 2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-22Add documentsyugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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