summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Increase SIZE_POOL_COUNT to 5Peter Zhu2022-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Expose `rb_hash_new_capa(long)`Jean Boussier2022-04-261-0/+11
| | | | | | | | [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.
* [Doc] correct my understanding about nonblocking mode卜部昌平2022-04-211-4/+17
| | | | | I was wrong. Nonblocking mode nowadays does not interface with IO#read. Document updated. [ci skip]
* [DOC] add missing size params in fiber scheduler.h (#5441)Alex Matchneer2022-04-141-0/+2
|
* Finer-grained constant cache invalidation (take 2)Kevin Newton2022-04-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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]
* re.c: Add Regexp.timeout= and Regexp.timeoutYusuke Endoh2022-03-301-0/+7
| | | | [Feature #17837]
* Revert "Finer-grained inline constant cache invalidation"Nobuyoshi Nakada2022-03-252-7/+2
| | | | | | | | | | | | 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.
* Finer-grained inline constant cache invalidationKevin Newton2022-03-242-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [Feature #18634] Implement Arrays on Variable Width AllocationPeter Zhu2022-03-222-2/+21
| | | | | | 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.
* Honor if `_Bool` is availableNobuyoshi Nakada2022-03-161-1/+1
| | | | `AC_HEADER_STDBOOL` rejects stdbool.h in c2x, which is not conforming to C99.
* Wrap ruby_abi_version in `extern "C"` for C++Peter Zhu2022-03-011-0/+8
| | | | | Make ruby_abi_version have C linkage so that the symbol can be found in the shared object.
* Only define RUBY_DLN_CHECK_ABI when supportedPeter Zhu2022-03-011-4/+2
|
* [DOC] Fix reference in rb_enc_associate() descriptionLars Kanis2022-03-011-2/+2
|
* [DOC] Fix function name in exampleLars Kanis2022-03-011-1/+1
|
* [Feature #18249] Implement ABI checkingPeter Zhu2022-02-222-0/+46
| | | | | | | | | | | | | | | | | | | | 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"]`.
* Check if `__assume` is supportedNobuyoshi Nakada2022-02-192-5/+1
|
* Define `HAVE___BUILTIN_UNREACHABLE` instead of `UNREACHABLE`Nobuyoshi Nakada2022-02-192-6/+1
| | | | | `UNREACHABLE` in ruby/internal/has/builtin.h is only used as just a flag now, and redefined in ruby/backward/2/assume.h then.
* Mark `rb_clear_constant_cache` as internal use onlyNobuyoshi Nakada2022-01-202-11/+3
| | | | | | In the past, many internal functions are declared in intern.h under include/ruby directory, because there were no headers for internal use.
* include/ruby/win32.h: explicitly define HAVE_SHUTDOWNYuta Saito2022-01-191-0/+2
| | | | | | | | | | | | 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
* include/ruby/io.h: use 0 as POLLPRI when no support for itYuta Saito2022-01-191-4/+3
| | | | | 0x003 is not suitable as a bit mask, and it's ok just to be 0 to avoid setting unsupported bit.
* [wasm] include/ruby/io.h: define RB_WAITFD_PRI by ourselves for wasiYuta Saito2022-01-191-1/+6
| | | | | RB_WAITFD_PRI uses POLLPRI for other platforms, but wasi-libc doesn't have POLLPRI for now.
* [wasm] add no thread variant for freestanding environmentYuta Saito2022-01-191-0/+6
| | | | | This implementation does nothing around preemptive context switching because there is no native thread.
* [wasm] wasm/missing.{c,h}: add missing libc stubs for wasi-libcYuta Saito2022-01-191-0/+113
|
* Don't assume __builtin_bswap32 and __builtin_bswap64 are defined on OpenBSDJeremy Evans2022-01-181-0/+2
| | | | | | 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).
* [Feature #18491] Drop support for HP-UXPeter Zhu2022-01-181-3/+0
| | | | | IA64 support was dropped in ticket #15894, so we can drop support for HP-UX.
* include/ruby/win32.h: define HAVE_X for the missing prototypes (#5456)Yuta Saito2022-01-181-1/+7
|
* Suppress possible loss of data warningsNobuyoshi Nakada2022-01-141-2/+3
|
* [DOC] Fix a typo in a docNobuyoshi Nakada2022-01-131-1/+1
|
* Enable Variable Width Allocation by defaultPeter Zhu2022-01-121-1/+1
|
* Make embedded string length a long for VWAPeter Zhu2022-01-121-1/+1
| | | | | A short (2 bytes) will cause unaligned struct accesses when strings are used as a buffer to directly store binary data.
* Revert "Enable Variable Width Allocation by default"Peter Zhu2022-01-081-1/+1
| | | | This reverts commit c365c5921ea26e31c03a85b01ff4c04629abfc10.
* Use unsigned short for length of embedded stringsPeter Zhu2022-01-071-1/+1
|
* Enable Variable Width Allocation by defaultPeter Zhu2022-01-071-1/+1
|
* Revert "Enable Variable Width Allocation by default"Peter Zhu2022-01-061-1/+1
| | | | This reverts commit d4a95428bb244ca8c4a97ad50f3837f191f1f0c3.
* Enable Variable Width Allocation by defaultPeter Zhu2022-01-061-1/+1
|
* Flush deprecation declarations for versions older than 3.0Nobuyoshi Nakada2021-12-301-50/+1
|
* Remove declarations of deprecated functionsNobuyoshi Nakada2021-12-301-12/+0
|
* Fix some bornheadsU.Nakamura2021-12-271-12/+1
|
* Call FlushInstrucitonCache() when PROT_EXEC is specified to mprotectU.Nakamura2021-12-271-2/+13
|
* Tiny mmap emulation for WindowsU.Nakamura2021-12-271-0/+19
| | | | | | | - 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`.
* Remove deprecate rb_cData [Bug #18433]Nobuyoshi Nakada2021-12-261-24/+0
| | | | Also enable the warning for T_DATA allocator.
* Remove tainted and trusted featuresNobuyoshi Nakada2021-12-265-149/+0
| | | | Already these had been announced to be removed in 3.2.
* Development of 3.1.0 started.Yukihiro "Matz" Matsumoto2021-12-261-1/+1
|
* Fix typos [ci skip]Kazuhiro NISHIYAMA2021-12-251-1/+1
|
* Improvements to `rb_io_wait` return value handling and internal ↵Samuel Williams2021-12-241-1/+1
| | | | implementation. (#5340)
* Add fiber scheduler hooks for `pread`/`pwrite`, and add support to `IO::Buffer`.Samuel Williams2021-12-232-0/+32
|
* Extended interface for IO::Buffer & documentation.Samuel Williams2021-12-221-4/+4
|
* Rename IMMUTABLE to READONLY.Samuel Williams2021-12-211-3/+5
|
* Improve interface for get/set/copy.Samuel Williams2021-12-211-1/+0
|
* Mark non-private mapped files as external.Samuel Williams2021-12-211-6/+10
|