path: root/include
AgeCommit message (Collapse)Author
2020-08-27git rm include/ruby/backward/rubysig.h卜部昌平
Notes: Merged:
2020-08-27git rm include/ruby/backward/{st,util}.h卜部昌平
Notes: Merged:
2020-08-27git rm include/ruby/backward/classext.h卜部昌平
Notes: Merged:
2020-08-27sed -i '\,2/extern.h,d'卜部昌平
Notes: Merged:
2020-08-27git rm include/ruby/backward/2/extern.h卜部昌平
Notes: Merged:
2020-08-21HAVE_STMT_AND_DECL_IN_EXPR: not for Sun C++卜部昌平
Because we check HAVE_STMT_AND_DECL_IN_EXPR in configure, it is peoven to work in C. But C++ situation can be different. Oracle Developer Studio is another example of such things. Notes: Merged:
2020-08-21RBIMPL_HAS_CPP_ATTRIBUTE: handle SunPro卜部昌平
Oracle Developer Studio's C++ preprocessor started to understand __has_cpp_attribute since version 12.5, and is broken. After looking around for a while I found Boost and ICU also had this issue before. Let me add workaround for it. Notes: Merged:
2020-08-19ROBJECT_IV_INDEX_TBL: convert into an inline function卜部昌平
Former ROBJECT_IV_INDEX_TBL macro included RCLASS_IV_INDEX_TBL, which is not disclosed to extension libraies. The macro was kind of broken. Why not just deprecate it, and convert the internal use into an inline function. Notes: Merged:
2020-08-15RARRAY_AREF: convert into an inline function卜部昌平
RARRAY_AREF has been a macro for reasons. We might not be able to change that for public APIs, but why not relax the situation internally to make it an inline function. Notes: Merged:
2020-08-14Enable arm64 optimizations that exist for power/x86 (#3393)AGSaidi
* Enable unaligned accesses on arm64 64-bit Arm platforms support unaligned accesses. Running the string benchmarks this change improves performance by an average of 1.04x, min .96x, max 1.21x, median 1.01x * arm64 enable gc optimizations Similar to x86 and powerpc optimizations. | |compare-ruby|built-ruby| |:------|-----------:|---------:| |hash1 | 0.225| 0.237| | | -| 1.05x| |hash2 | 0.110| 0.110| | | 1.00x| -| * vm_exec.c: improve performance for arm64 | |compare-ruby|built-ruby| |:------------------------------|-----------:|---------:| |vm_array | 26.501M| 27.959M| | | -| 1.06x| |vm_attr_ivar | 21.606M| 31.429M| | | -| 1.45x| |vm_attr_ivar_set | 21.178M| 26.113M| | | -| 1.23x| |vm_backtrace | 6.621| 6.668| | | -| 1.01x| |vm_bigarray | 26.205M| 29.958M| | | -| 1.14x| |vm_bighash | 504.155k| 479.306k| | | 1.05x| -| |vm_block | 16.692M| 21.315M| | | -| 1.28x| |block_handler_type_iseq | 5.083| 7.004| | | -| 1.38x| Notes: Merged-By: nurse <>
2020-08-07sync NDEBUG, RUBY_DEBUG, and RUBY_NDEBUG (#3327)卜部昌平
- When NDEBUG is defined that shall be honoured. - When RUBY_DEBUG is defined that shall be honoured. - When both are defined and they conflict, warnings shall be rendered. - When nothing is specified, nothing shall happen. Notes: Merged-By: shyouhei <>
2020-07-23include/ruby/util.h: delete unused codes卜部昌平
- util.h includes defines.h, - ... which includes ruby/backward/2/stdarg.h, - ... which always defines _. This `#ifndef _` must never happen. Notes: Merged:
2020-07-20Move declarations to private `internal/thread.h` header.Samuel Williams
Notes: Merged:
2020-07-20Rename `rb_current_thread_scheduler` to `rb_thread_scheduler_if_nonblocking`.Samuel Williams
Correctly capture thread before releasing GVL and pass as argument to `rb_thread_scheduler_if_nonblocking`. Notes: Merged:
2020-06-29Revert "RBIMPL_UNREACHABLE_RETURN: evaluate the argument"卜部昌平
This reverts commit c8dc2bf1401fc01d35a4a7587ed224f1f2fe29e6. No longer necessary.
2020-06-29RBIMPL_UNREACHABLE_RETURN: evaluate the argument卜部昌平
Prevent casual typos inside of UNREACHABLE_RETURN(...). Notes: Merged:
2020-05-29RUBY_ASSERT_NOASSUMEKoichi Sasada
If __builtin_assume() is enables and RUBY_DEBUG=0, RUBY_ASSERT(expr) will be compiled to __builtin_assume(expr) and compiler can assume expr is true and apply aggressive optimizations. However we observed doubtful behavior because of compiler optimizations, we introduce new macro RUBY_ASSERT_NOASSUME to disable __builtin_assume(). With this macro, we can try without __builtin_assume().
2020-05-27Removed a trailing space [ci skip]Nobuyoshi Nakada
2020-05-26Get rid of redefinition of memcpy on mingwNobuyoshi Nakada
2020-05-26Update include/ruby/assert.hKoichi Sasada
Co-authored-by: 卜部昌平 <> Notes: Merged:
2020-05-26Use RUBY_DEBUG instead of NDEBUGKoichi Sasada
Assertions in header files slows down an interpreter, so they should be turned off by default (simple `make`). To enable them, define a macro `RUBY_DEBUG=1` (e.g. `make cppflags=-DRUBY_DEBUG` or use `#define` at the very beggining of the file. Note that even if `NDEBUG=1` is defined, `RUBY_DEBUG=1` enables all assertions. [Feature #16837] related: `assert()` lines in MRI *.c is not disabled even if `RUBY_DEBUG=0` and it can be disabled with `NDEBUG=1`. So please consider to use `RUBY_ASSERT()` if you want to disable them when `RUBY_DEBUG=0`. Notes: Merged:
2020-05-25RBIMPL_ATTR_DEPRECATED: disable for GCC10卜部昌平
GCC 10.x seems buggy here. See also
2020-05-21Added UNREACHABLE_RETURNNobuyoshi Nakada
To get rid of a void function at the end of non-void function.
2020-05-21rb_scan_args_set: make it slightly readable卜部昌平
This is a pure refactoring that improves understanding of what is going on. Not a big win though.
2020-05-20Use __bultin_assume() from clang-7Koichi Sasada
We observed combination of multiple __builtin_assume() can cause strange compile results on clang-6 (-DNDEBUG exposed this issue). To avoid this problem, __builtin_assume() is from clang-7. Notes: Merged:
2020-05-14Thread scheduler for light weight concurrency.Samuel Williams
Notes: Merged: Merged-By: ioquatix <>
2020-05-12Removed extra stringizationNobuyoshi Nakada
Argument of RUBY_ASSERT_FAIL is already stringized message, so no more extra stringization should be applied.
2020-05-11fix sunpro pragma卜部昌平
SunPro's #pragma does_not_return(...) needs an argument. That does not fit the attribute syntax we employ.
2020-05-11drop varargs.h support卜部昌平
This header file is simply out of date (for decades since at least 1989). It's the 21st century. Just stop using it.
2020-05-11rb_str_new: hoist RB_CONSTANT_P out of function卜部昌平 says: > GCC never returns 1 when you call the inline function with a string > constant or ... Because rb_str_new and familiy take string constants, it was a bad idea for them to contain RB_CONSTANT_P. We should instead do so in corresponding macros. [ruby-core:98212] Notes: Merged:
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged:
2020-05-11mv include/ruby/{impl,internal}卜部昌平
Devs do not love "impl". Notes: Merged:
2020-05-11spaces in comments [ci skip]卜部昌平
Notes: Merged:
2020-05-11sed -i s/ruby3/rbimpl/g卜部昌平
Notes: Merged:
2020-05-11sed -i s/RUBY3/RBIMPL/g卜部昌平
Devs do not love "3". The only exception is RUBY3_KEYWORDS in parse.y, which seems unrelated to our interests. Notes: Merged:
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged:
2020-05-11mv include/ruby/{3,impl}卜部昌平
Devs do not love "3". Notes: Merged:
2020-05-08Classes made from Struct should have default `new` singleton method.Marc-Andre Lafortune
[Bug #16465] [Bug #16801] [Fix GH-2795] [Fix GH-2944] [Fix GH-3045] [Fix GH-3093] Note: Backporting shouldn't modify object.h and instead can use struct_new_kw which is basically a duplicate implementation of rb_class_new_instance_pass_kw Co-authored-by: Yusuke Endoh <> Co-authored-by: John Hawthorn <> Co-authored-by: Adam Hess <> Co-authored-by: Jose Cortinas <> Co-authored-by: Jean Boussier <> Notes: Merged:
2020-05-01Get rid of -Wgnu-zero-variadic-macro-arguments errorsNobuyoshi Nakada
As zero variadic macro argument, `rb_scan_args(argc, argv, "")` (or `"0"`), means 0-arity method and should be defined so, that case doesn't need to consider.
2020-04-30Remove deprecated rb_require_safeJeremy Evans
Notes: Merged:
2020-04-25More enums are mandatory for rp in lldb_cruby.pyNobuyoshi Nakada
2020-04-21Fix typos [ci skip]Kazuhiro NISHIYAMA
2020-04-18RUBY_SPECIAL_SHIFT and RUBY_FL_USHIFT are mandatory for rp in lldb_cruby.pyNobuyoshi Nakada
2020-04-16fix compiler error on gcc 4.x卜部昌平
It seems gcc prior to 5 suffered from preprocessor bug. We have to provide workarounds. See ---- Here is something interesting. According to C99, strictly speaking, the gcc behaviour was in fact legal(!) and everything else were wrong. This was not a bug of gcc, rather a bug of the ISO C Standard. This defect was reported to the committee as DR#412, and fixed accordingly. All tested compilers now conform C17's updated preprocessor description. See
2020-04-16Support for FreeBSD <sys/cdefs.h>卜部昌平
FreeBSD's <sys/cdefs.h> is broken. Cygwin is also affected by that. We need to avoid using them. See also:;a=commit;f=newlib/libc/include/sys/cdefs.h;h=44d6d53977e6bc82c2b1e6dbe8ae7f310b260604
2020-04-13include what you use.卜部昌平
This reverts commit 443389effc37308ce1a3c3a840082a344fc6af56. This reverts commit d94960f22ec2de3a3855305cb51343806d2b46c7. Inclusion of header files must be explicit. Every file shall directly include what is necessary. says: > When every file includes what it uses, then it is possible to edit any > file and remove unused headers, without fear of accidentally breaking > the upwards dependencies of that file. It also becomes easy to > automatically track and update dependencies in the source code. Though we don't use iwyu itself, the principle quoted above is a good thing that we can agree. Now that include guards were added to every and all of the headers inside of our project this changeset does not increase compile time, at least on my machine. Notes: Merged:
2020-04-13add #include guard hack卜部昌平
According to MSVC manual (*1), cl.exe can skip including a header file when that: - contains #pragma once, or - starts with #ifndef, or - starts with #if ! defined. GCC has a similar trick (*2), but it acts more stricter (e. g. there must be _no tokens_ outside of #ifndef...#endif). Sun C lacked #pragma once for a looong time. Oracle Developer Studio 12.5 finally implemented it, but we cannot assume such recent version. This changeset modifies header files so that each of them include strictly one #ifndef...#endif. I believe this is the most portable way to trigger compiler optimizations. [Bug #16770] *1: *2: Notes: Merged:
2020-04-12Make rb_scan_args implementations sameNobuyoshi Nakada
between rb_scan_args_set and rb_scan_args_assign + rb_scan_args_result.
2020-04-10RUBY3_HAS_ATTRIBUTE: fix fallbacks卜部昌平
Same as 133ae0807d661eac174b59c6e91c11a40975baea
2020-04-10include/ruby/3: do not skip RUBY3_UNREACHABLE_RETURN卜部昌平
Revert "Revert "include/ruby/3/core/rtypeddata.h: Use 0 instead of NULL for C++ compiler"" Revert "include/ruby/3/core/rtypeddata.h: Use 0 instead of NULL for C++ compiler" Revert "include/ruby/3: Skip RUBY3_UNREACHABLE_RETURN for icc" Revert "include/ruby/3: Stop RUBY3_UNREACHABLE_RETURN to suppress a SunC warning" This reverts commit b965e7e05e4307e3c4b396673e63dbc493ef2f20. This reverts commit d2bb2e066b5a914283dd3ea473fc1762183af013. This reverts commit 8ab4c55e7a70f5a5bd041d93f425eeef4a47c01e. This reverts commit 78eec3cdc5ff0664b421e041f4f70a814542b914. After, we no longer need these ifdef guards.