2059 Commits
Author SHA1 Message Date
Samuel WilliamsandLuke Gruber e900e9fc9a Use ec->interrupt_mask to prevent interrupts. [Backport #21610]
Disallow pending interrupts to be checked during `FiberScheduler#unblock`.

Ractors can send signals at any time, so the previous debug assertion can fail if a Ractor sends a signal.

Co-authored-by: Luke Gruber <luke.gruber@shopify.com>
2025-09-18 03:24:02 +00:00
Earlopain c63d6bee7b Explicitly use a ruby version for prism to parse the code as
Prism can parse multiple versions of ruby. Because of that branch release managers are ok with simply
bumping prism to its latest version.

However, if no version is specified, it will parse as the latest known version, which can be ahead of the maintenance branch.
So we need to explicitly pass a version to not accidentally introduce new syntax to maintenance branches.
2025-09-12 14:30:16 -07:00
Takashi Kokubun 596126ee5a merge revision(s) b42afa1dbc, f1f0cc14cc, 543e3a1896, ed2806117a, 46e4c86737: [Backport #21500]
Suppress gcc 15 unterminated-string-initialization warnings

	Separate `__has_attribute` from `defined(__has_attribute)`

	Fix Visual C warnings:
	```
	regenc.h(121): warning C4067: unexpected tokens following preprocessor directive - expected a newline
	```

	Cast up `int` instruction code to `VALUE`

	Fix Visual C warnings:
	```
	iseq.c(3793): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size
	iseq.c(3794): warning C4312: 'type cast': conversion from 'int' to 'void *' of greater size
	```

	Do not let files depend on a phony target

	Detect `clock_gettime` and `clock_getres` for winpthreads
2025-07-14 14:50:56 -07:00
Takashi Kokubun 82e05dc945 merge revision(s) f6cbf499bc: [Backport #21354]
Fix Symbol#to_proc (rb_sym_to_proc) to be ractor safe

	In non-main ractors, don't use `sym_proc_cache`. It is not thread-safe
	to add to this array without a lock and also it leaks procs from one
	ractor to another. Instead, we create a new proc each time. If this
	results in poor performance we can come up with a solution later.

	Fixes [Bug #21354]
2025-07-14 14:10:16 -07:00
Takashi Kokubun 65e02ab1a6 merge revision(s) 3e47e7a499, b48b841378, 2fe8b9cd3d: [Backport #21327]
Fix redefinition of `clock_gettime` and `clock_getres`

	winpthreads-git 12.0.0.r720 provides `clock_gettime` and
	`clock_getres` as inline functions.

	digest.so needs ruby/digest.h which is installed by build-ext

	Copy to path with the base name
2025-05-13 17:18:43 -07:00
John HawthornandAlan Wu 698741d73a Replace tombstone when converting AR to ST hash
[Bug #21170]

st_table reserves -1 as a special hash value to indicate that an entry
has been deleted. So that that's a valid value to be returned from the
hash function, do_hash replaces -1 with 0 so that it is not mistaken for
the sentinel.

Previously, when upgrading an AR table to an ST table,
rb_st_add_direct_with_hash was used which did not perform the same
conversion, this could lead to a hash in a broken state where one if its
entries which was supposed to exist being marked as a tombstone.

The hash could then become further corrupted when the ST table required
resizing as the falsely tombstoned entry would be skipped but it would
be counted in num entries, leading to an uninitialized entry at index
15.

In most cases this will be really rare, unless using a very poorly
implemented custom hash function.

This also adds two debug assertions, one that st_add_direct_with_hash
does not receive the reserved hash value, and a second in
rebuild_table_with, which ensures that after we rebuild/compact a table
it contains the expected number of elements.

Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2025-03-05 15:15:45 -08:00
Nobuyoshi Nakada 970513f677 Sort undocumented entry list [ci skip] 2024-12-25 12:04:32 +09:00
Nobuyoshi Nakada f7ce62cc5b Add hello 2024-12-22 23:14:03 +09:00
Nobuyoshi Nakada 4fb5d746ce Split modular-gc into build and installation 2024-12-22 22:10:26 +09:00
Hiroshi SHIBATA 6a1aaf3679 Separated load path for test-bundler tasks for Windows 2024-12-12 15:10:21 +09:00
Hiroshi SHIBATA f43e04ce09 Hide pending results of turbo_tests 2024-12-12 14:43:07 +09:00
Hiroshi SHIBATA 1967ae20b9 Use patched version of turbo_tests 2024-12-12 14:43:07 +09:00
Hiroshi SHIBATA 91f6c370af Use turbo_tests instead of parallel_tests 2024-12-12 14:43:07 +09:00
Nobuyoshi Nakada f12e2622c1 Split system dependent commands to clean modular-gc 2024-12-10 12:31:47 +09:00
Peter Zhu cfc2b21a05 Clean all modular GCs
We should run `make clean` or `make distclean` on each of the GC directories.
2024-12-09 16:35:21 -05:00
Peter Zhu 5d4242fa81 Only delete gc directory if empty
If building in the source directory, this will delete the gc directory.
2024-12-09 16:35:21 -05:00
Peter Zhu 88d49628dd Don't delete .gc directory
We build in the gc directory since commit d057503252,
so we don't need to remove the .gc directory.
2024-12-09 16:35:21 -05:00
Matt Valentine-House ffb26a53d1 Add Modular GC (default, MMTk) builds to CI 2024-12-06 09:48:30 +00:00
b021f6f8a7 Use symbol.h in vm.c to get macro for faster ID to sym (#12272)
The macro provided by symbol.h uses STATIC_ID2SYM
when it can which speeds up methods that declare keyword args.

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-12-05 17:51:32 -05:00
Peter Zhu ce1ad1b816 Standardize on the name "modular GC"
We have name fragmentation for this feature, including "shared GC",
"modular GC", and "external GC". This commit standardizes the feature
name to "modular GC" and the implementation to "GC library".
2024-12-05 10:33:26 -05:00
Hiroshi SHIBATA 56576b6cce Removed needless RSpec option 2024-12-04 13:09:40 +09:00
Hiroshi SHIBATA b532662d2d Use same RSPECOPTS for test-bundler and test-bundler-parallel 2024-12-04 13:09:40 +09:00
Nobuyoshi Nakada 239c30798a Simplify test-bundler-parallel
Get rid of repeated exec XRUBY recursively.
2024-12-04 13:09:40 +09:00
Hiroshi SHIBATA 4e382c285f Lock json-schema-5.1.0 2024-12-03 09:53:17 +09:00
Nobuyoshi Nakada 1df52e097b yasmdata.rb is no longer generated for years [ci skip] 2024-12-02 09:07:25 +09:00
Nobuyoshi Nakada c321cf0e95 Revert useless VPATH for NMAKE [ci skip] 2024-11-30 23:57:42 +09:00
Nobuyoshi Nakada fdf60d735c Win32: Fix dependencies with VPATH on nmake 2024-11-30 15:24:30 +09:00
Hiroshi SHIBATA 26aebdb6d6 Added --env option to mspec for test-bundled-gems 2024-11-27 16:45:10 +09:00
Hiroshi SHIBATA 671e6eb644 Run only specified bundled gems with BUNDLED_GEMS 2024-11-27 16:45:10 +09:00
Nobuyoshi Nakada 9508cf86de Clear shared_gc directory 2024-11-26 19:06:21 +09:00
Nobuyoshi Nakada d057503252 Use extmk.rb to configure shared GC
Since mkmf.rb is for extension libraries after installation, it cannot
work alone in build directory and needs to run from extmk.rb.
2024-11-26 19:06:21 +09:00
Nobuyoshi Nakada c5d31cb96b Shell dependent command should be in Makefile.in
As common.mk is used by nmake.exe, the commands there need to be
accepted also by cmd.exe.
2024-11-26 19:06:21 +09:00
Matt Valentine-HouseandPeter Zhu d61933e503 Use extconf to build external GC modules
Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
2024-11-25 13:05:23 +00:00
Kunshan Wang 8ae7c22972 Annotate anonymous mmap
Use PR_SET_VMA_ANON_NAME to set human-readable names for anonymous
virtual memory areas mapped by `mmap()` when compiled and run on Linux
5.17 or higher.  This makes it convenient for developers to debug mmap.
2024-11-21 13:48:05 -05:00
Samuel Williams 3c0b09ac9e Allow io_buffer_memmove to release the GVL for large buffers. (#12021)
[Feature #20902]
2024-11-20 21:27:16 +13:00
Samuel Williams 9c268302bf Introduce Fiber::Scheduler#blocking_operation_wait. (#12016)
Redirect `rb_nogvl` blocking operations to the fiber scheduler if possible
to prevent stalling the event loop.

[Feature #20876]
2024-11-20 19:40:17 +13:00
Hiroshi SHIBATA 07bf784066 Don't need to call test-bundled-gems-fetch for bundled_gems_spec-run 2024-11-18 20:46:07 +09:00
Hiroshi SHIBATA 2dc8c48e09 Need to install all of dependency for bundler test suite 2024-11-18 20:46:07 +09:00
Hiroshi SHIBATA 73614b6efe Added PREPARE_BUNDLED_GEMS before bundled_gems_spec-run 2024-11-18 20:46:07 +09:00
Hiroshi SHIBATA 0c8bd35ba4 Install zeitwerk at test-bundled-gems-prepare 2024-11-18 20:46:07 +09:00
Hiroshi SHIBATA ce580f4ae5 Fixed dependency of make test-bundled-gems 2024-11-18 20:46:07 +09:00
Hiroshi SHIBATA 1a416920f1 Load required helpers from bundler examples and invoke bundled_gems_spec.rb at test-bundled-gems 2024-11-18 20:46:07 +09:00
Hiroshi SHIBATA 498c960a12 Install zeitwerk without bundle install 2024-11-18 15:48:20 +09:00
Peter Zhu 54ff9d3525 Remove dependency of version.c on gc/gc.h
version.c does not depend on gc/gc.h.
2024-11-14 07:50:05 -06:00
Matt Valentine-House ee290c94a3 Include the currently active GC in RUBY_DESCRIPTION
This will add +MOD_GC to the version string and Ruby description when
Ruby is compiled with shared gc support.

When shared GC support is compiled in and a GC module has been loaded
using RUBY_GC_LIBRARY, the version string will include the name of
the currently active GC as reported by the rb_gc_active_gc_name function
in the form

+MOD_GC[gc_name]

[Feature #20794]
2024-11-14 10:46:36 +00:00
Koichi Sasada 8d88d35fc1 correct dependencies 2024-11-08 18:02:46 +09:00
Samuel Williams 3b9896acfc Revert "Introduce Fiber Scheduler blocking_region hook. (#11963)" (#12013)
This reverts some of commit 87fb44dff6.

We will rename and propose a slightly different interface.
2024-11-06 22:19:40 +13:00
Yusuke Endoh 7e9c5903a8 Update dependency 2024-11-05 17:55:59 +09:00
Takashi Kokubun 478e0fc710 YJIT: Replace Array#each only when YJIT is enabled (#11955)
* YJIT: Replace Array#each only when YJIT is enabled

* Add comments about BUILTIN_ATTR_C_TRACE

* Make Ruby Array#each available with --yjit as well

* Fix all paths that expect a C location

* Use method_basic_definition_p to detect patches

* Copy a comment about C_TRACE flag to compilers

* Rephrase a comment about add_yjit_hook

* Give METHOD_ENTRY_BASIC flag to Array#each

* Add --yjit-c-builtin option

* Allow inconsistent source_location in test-spec

* Refactor a check of BUILTIN_ATTR_C_TRACE

* Set METHOD_ENTRY_BASIC without touching vm->running
2024-11-04 11:14:28 -05:00
Peter Zhu 29c480dd6f [Bug #20853] Fix Proc#hash to not change after compaction
The hash value of a Proc must remain constant after a compaction, otherwise
it may not work as the key in a hash table.
2024-11-01 10:49:50 -04:00