summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2022-05-23Remove unnecessary module flag, add module assertions to other module flagsJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/5930
2022-05-19Undefine RUBY_DLN_CHECK_ABI on cygwinDaisuke Fujimura (fd0)
Notes: Merged: https://github.com/ruby/ruby/pull/5810
2022-05-09Increase SIZE_POOL_COUNT to 5Peter Zhu
Having more size pools will allow us to allocate larger objects through Variable Width Allocation. I have attached some benchmark results below. Discourse: On Discourse, we don't see much change in response times. We do see a small reduction in RSS. Branch RSS: 377.8 MB Master RSS: 396.3 MB railsbench: On railsbench, we don't see a big change in RPS or p99 performance. We see a small increase in RSS. Branch RPS: 815.38 Master RPS: 811.73 Branch p99: 1.69 ms Master p99: 1.68 ms Branch RSS: 90.6 MB Master RSS: 89.4 MB liquid: We don't see a significant change in liquid performance. Branch parse & render: 29.041 I/s Master parse & render: 29.211 I/s Notes: Merged: https://github.com/ruby/ruby/pull/5885
2022-04-26Expose `rb_hash_new_capa(long)`Jean Boussier
[Feature #18683] This allows parsers and similar libraries to create Hashes of a certain capacity in advance. It's useful when the key and values are streamed, hence `bulk_insert()` can't be used. Notes: Merged: https://github.com/ruby/ruby/pull/5835
2022-04-21[Doc] correct my understanding about nonblocking mode卜部昌平
I was wrong. Nonblocking mode nowadays does not interface with IO#read. Document updated. [ci skip]
2022-04-14[DOC] add missing size params in fiber scheduler.h (#5441)Alex Matchneer
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-04-01Finer-grained constant cache invalidation (take 2)Kevin Newton
This commit reintroduces finer-grained constant cache invalidation. After 8008fb7 got merged, it was causing issues on token-threaded builds (such as on Windows). The issue was that when you're iterating through instruction sequences and using the translator functions to get back the instruction structs, you're either using `rb_vm_insn_null_translator` or `rb_vm_insn_addr2insn2` depending if it's a direct-threading build. `rb_vm_insn_addr2insn2` does some normalization to always return to you the non-trace version of whatever instruction you're looking at. `rb_vm_insn_null_translator` does not do that normalization. This means that when you're looping through the instructions if you're trying to do an opcode comparison, it can change depending on the type of threading that you're using. This can be very confusing. So, this commit creates a new translator function `rb_vm_insn_normalizing_translator` to always return the non-trace version so that opcode comparisons don't have to worry about different configurations. [Feature #18589] Notes: Merged: https://github.com/ruby/ruby/pull/5716
2022-03-30re.c: Add Regexp.timeout= and Regexp.timeoutYusuke Endoh
[Feature #17837] Notes: Merged: https://github.com/ruby/ruby/pull/5703
2022-03-25Revert "Finer-grained inline constant cache invalidation"Nobuyoshi Nakada
This reverts commits for [Feature #18589]: * 8008fb7352abc6fba433b99bf20763cf0d4adb38 "Update formatting per feedback" * 8f6eaca2e19828e92ecdb28b0fe693d606a03f96 "Delete ID from constant cache table if it becomes empty on ISEQ free" * 629908586b4bead1103267652f8b96b1083573a8 "Finer-grained inline constant cache invalidation" MSWin builds on AppVeyor have been crashing since the merger. Notes: Merged: https://github.com/ruby/ruby/pull/5715 Merged-By: nobu <nobu@ruby-lang.org>
2022-03-24Finer-grained inline constant cache invalidationKevin Newton
Current behavior - caches depend on a global counter. All constant mutations cause caches to be invalidated. ```ruby class A B = 1 end def foo A::B # inline cache depends on global counter end foo # populate inline cache foo # hit inline cache C = 1 # global counter increments, all caches are invalidated foo # misses inline cache due to `C = 1` ``` Proposed behavior - caches depend on name components. Only constant mutations with corresponding names will invalidate the cache. ```ruby class A B = 1 end def foo A::B # inline cache depends constants named "A" and "B" end foo # populate inline cache foo # hit inline cache C = 1 # caches that depend on the name "C" are invalidated foo # hits inline cache because IC only depends on "A" and "B" ``` Examples of breaking the new cache: ```ruby module C # Breaks `foo` cache because "A" constant is set and the cache in foo depends # on "A" and "B" class A; end end B = 1 ``` We expect the new cache scheme to be invalidated less often because names aren't frequently reused. With the cache being invalidated less, we can rely on its stability more to keep our constant references fast and reduce the need to throw away generated code in YJIT. Notes: Merged: https://github.com/ruby/ruby/pull/5433
2022-03-22[Feature #18634] Implement Arrays on Variable Width AllocationPeter Zhu
This commit implements arrays on Variable Width Allocation. This allows longer arrays to be embedded (i.e. contents directly follow the object header) which improves performance through better cache locality. Notes: Merged: https://github.com/ruby/ruby/pull/5660
2022-03-16Honor if `_Bool` is availableNobuyoshi Nakada
`AC_HEADER_STDBOOL` rejects stdbool.h in c2x, which is not conforming to C99. Notes: Merged: https://github.com/ruby/ruby/pull/5666 Merged-By: nobu <nobu@ruby-lang.org>
2022-03-01Wrap ruby_abi_version in `extern "C"` for C++Peter Zhu
Make ruby_abi_version have C linkage so that the symbol can be found in the shared object.
2022-03-01Only define RUBY_DLN_CHECK_ABI when supportedPeter Zhu
2022-03-01[DOC] Fix reference in rb_enc_associate() descriptionLars Kanis
Notes: Merged: https://github.com/ruby/ruby/pull/5534
2022-03-01[DOC] Fix function name in exampleLars Kanis
Notes: Merged: https://github.com/ruby/ruby/pull/5599
2022-02-22[Feature #18249] Implement ABI checkingPeter Zhu
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which is the ABI version. This value should be bumped whenever an ABI incompatible change is introduced. When loading dynamic libraries, Ruby will compare its own `ruby_abi_version` and the `ruby_abi_version` of the loaded library. If these two values don't match it will raise a `LoadError`. This feature can also be turned off by setting the environment variable `RUBY_RUBY_ABI_CHECK=0`. This feature will prevent cases where previously installed native gems fail in unexpected ways due to incompatibility of changes in header files. This will force the developer to recompile their gems to use the same header files as the built Ruby. In Ruby, the ABI version is exposed through `RbConfig::CONFIG["ruby_abi_version"]`. Notes: Merged: https://github.com/ruby/ruby/pull/5474
2022-02-19Check if `__assume` is supportedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5577
2022-02-19Define `HAVE___BUILTIN_UNREACHABLE` instead of `UNREACHABLE`Nobuyoshi Nakada
`UNREACHABLE` in ruby/internal/has/builtin.h is only used as just a flag now, and redefined in ruby/backward/2/assume.h then. Notes: Merged: https://github.com/ruby/ruby/pull/5577
2022-01-20Mark `rb_clear_constant_cache` as internal use onlyNobuyoshi Nakada
In the past, many internal functions are declared in intern.h under include/ruby directory, because there were no headers for internal use.
2022-01-19include/ruby/win32.h: explicitly define HAVE_SHUTDOWNYuta Saito
Configuration for mingw32 can't detect 'shutdown' due to wrong -l option even though it's available (this has been going on for a while, and it needs to be fixed). In this situation, include/ruby/missing.h declares a stub shutdown function since 7ee786388a, and another shutdown decl is came from system header. They are incompatible at stdcall attribute, so it causes compilation failure. This change defines a HAVE_SHUTDOWN to guard a newly introduced stub decl in include/ruby/missing.h Notes: Merged: https://github.com/ruby/ruby/pull/5465
2022-01-19include/ruby/io.h: use 0 as POLLPRI when no support for itYuta Saito
0x003 is not suitable as a bit mask, and it's ok just to be 0 to avoid setting unsupported bit. Notes: Merged: https://github.com/ruby/ruby/pull/5461
2022-01-19[wasm] include/ruby/io.h: define RB_WAITFD_PRI by ourselves for wasiYuta Saito
RB_WAITFD_PRI uses POLLPRI for other platforms, but wasi-libc doesn't have POLLPRI for now. Notes: Merged: https://github.com/ruby/ruby/pull/5407
2022-01-19[wasm] add no thread variant for freestanding environmentYuta Saito
This implementation does nothing around preemptive context switching because there is no native thread. Notes: Merged: https://github.com/ruby/ruby/pull/5407
2022-01-19[wasm] wasm/missing.{c,h}: add missing libc stubs for wasi-libcYuta Saito
Notes: Merged: https://github.com/ruby/ruby/pull/5407
2022-01-18Don't assume __builtin_bswap32 and __builtin_bswap64 are defined on OpenBSDJeremy Evans
At least OpenBSD/sparc64 doesn't appear to define them, and possibly some other OpenBSD GCC platforms don't (most OpenBSD platforms have already switched to clang).
2022-01-18[Feature #18491] Drop support for HP-UXPeter Zhu
IA64 support was dropped in ticket #15894, so we can drop support for HP-UX. Notes: Merged: https://github.com/ruby/ruby/pull/5457
2022-01-18include/ruby/win32.h: define HAVE_X for the missing prototypes (#5456)Yuta Saito
Notes: Merged-By: kateinoigakukun
2022-01-14Suppress possible loss of data warningsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5435
2022-01-13[DOC] Fix a typo in a docNobuyoshi Nakada
2022-01-12Enable Variable Width Allocation by defaultPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/5432
2022-01-12Make embedded string length a long for VWAPeter Zhu
A short (2 bytes) will cause unaligned struct accesses when strings are used as a buffer to directly store binary data. Notes: Merged: https://github.com/ruby/ruby/pull/5432
2022-01-08Revert "Enable Variable Width Allocation by default"Peter Zhu
This reverts commit c365c5921ea26e31c03a85b01ff4c04629abfc10.
2022-01-07Use unsigned short for length of embedded stringsPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/5415
2022-01-07Enable Variable Width Allocation by defaultPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/5413
2022-01-06Revert "Enable Variable Width Allocation by default"Peter Zhu
This reverts commit d4a95428bb244ca8c4a97ad50f3837f191f1f0c3. Notes: Merged: https://github.com/ruby/ruby/pull/5405
2022-01-06Enable Variable Width Allocation by defaultPeter Zhu
Notes: Merged: https://github.com/ruby/ruby/pull/5399
2021-12-30Flush deprecation declarations for versions older than 3.0Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5378
2021-12-30Remove declarations of deprecated functionsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5377
2021-12-27Fix some bornheadsU.Nakamura
2021-12-27Call FlushInstrucitonCache() when PROT_EXEC is specified to mprotectU.Nakamura
2021-12-27Tiny mmap emulation for WindowsU.Nakamura
- prerequisite of supporting YJIT with VC++. - note that now can specfily `--yjit` on mswin64, but not enabled YJIT'ed code because of YJIT requires `OPT_DIRECT_THREADED_CODE` or `OPT_CALL_THREADED_CODE` in `rb_yjit_compile_iseq`.
2021-12-26Remove deprecate rb_cData [Bug #18433]Nobuyoshi Nakada
Also enable the warning for T_DATA allocator. Notes: Merged: https://github.com/ruby/ruby/pull/5348
2021-12-26Remove tainted and trusted featuresNobuyoshi Nakada
Already these had been announced to be removed in 3.2. Notes: Merged: https://github.com/ruby/ruby/pull/5348
2021-12-26Development of 3.1.0 started.Yukihiro "Matz" Matsumoto
2021-12-25Fix typos [ci skip]Kazuhiro NISHIYAMA
2021-12-24Improvements to `rb_io_wait` return value handling and internal ↵Samuel Williams
implementation. (#5340) Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-12-23Add fiber scheduler hooks for `pread`/`pwrite`, and add support to `IO::Buffer`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5249 Merged-By: ioquatix <samuel@codeotaku.com>
2021-12-22Extended interface for IO::Buffer & documentation.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5314 Merged-By: ioquatix <samuel@codeotaku.com>
2021-12-21Rename IMMUTABLE to READONLY.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303