Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bb472c5
[ruby/ipaddr] extra multicast/unicast predicates
HoneyryderChuck Jun 22, 2026
e9444aa
[Feature #22185] Add alignment directives to pack templates
nobu Jun 10, 2026
8695116
Get rid of ROBJECT_HEAP flag
byroot Jul 15, 2026
eef14ff
[ruby/prism] ruby_parser: require timeout since it uses it.
zenspider Jul 12, 2026
5840692
[ruby/prism] ruby_parser: add ability to track scopes across parses.
zenspider Jul 12, 2026
d81da86
[ruby/prism] ruby_parser: add ability to subclass compiler to overrid…
zenspider Jul 12, 2026
a706e28
[ruby/prism] Use same type for scopes across translators
kddnewton Jul 15, 2026
65bb510
gc.c: Refactor rb_gc_obj_needs_cleanup_p
byroot Jul 15, 2026
cd5e5c0
[Feature #22185] [DOC] Add the reference
nobu Jul 15, 2026
92e4ea7
[DOC] Mark the undocumented method
nobu Jul 15, 2026
5138754
[Feature #22175] Add `Range#clamp`
nobu Jul 2, 2026
b061f5c
[ruby/erb] Fix wrong receiver in eoutvar example for #src
hsbt Jul 15, 2026
d90de90
ZJIT: Write full C method names in stats (#17895)
tekknolagi Jul 15, 2026
6cd755d
variable.c: generalize use of `rb_obj_fields()`
byroot Jul 15, 2026
e9c87a9
ZJIT: Merge send and send_without_block counters (#17721)
tekknolagi Jul 15, 2026
1790ac4
[ruby/prism] Fix up buffer treatment of stream parsing
kddnewton Jul 15, 2026
d7bdc2a
Windows: Skip csv tests for ractor which look hanging up
nobu Jul 15, 2026
2619d3a
Windows: Skip debug tests using pty
nobu Jul 15, 2026
6e84288
Start heavy tests first
nobu Jul 15, 2026
efb3a73
rb_imemo_fields_ptr: assume embedded
byroot Jul 15, 2026
0b68124
Get rid of ROBJECT_FIELDS_COUNT
byroot Jul 15, 2026
0afd762
Get rid of ROBJECT_FIELDS_CAPACITY
byroot Jul 15, 2026
74bd057
Get rid of ROBJECT_FIELDS_HASH
byroot Jul 15, 2026
0abe244
Make Time.at w/ in: 1.5x faster
skipkayhil Jul 15, 2026
a758990
Make Time.at w/ in: another 1.2x faster
skipkayhil Jul 15, 2026
f7eca0d
Batch cleanup geniv before sweep
jhawthorn Jul 9, 2026
8362689
make_shareable: Avoid VM lock for decl_marking
jhawthorn Jul 2, 2026
697afb1
Use slightly faster versions of functions
jhawthorn Jul 2, 2026
e98b8fd
Only iterate ivars when they exist
jhawthorn Jul 2, 2026
e51c4e6
ZJIT: rename gc_fast_path_new_obj -> gc_fastpath_new_obj
eightbitraptor Jul 15, 2026
5167ab8
set RUBY_DEBUG_TEST_NO_REMOTE=1 for debug.gem
ko1 Jul 15, 2026
faa3cc8
Fix Ractor move source husk breaking compaction slot size invariant
ko1 Jul 15, 2026
c7c0483
ractor.c: preserve aliasing during Ractor move
ianks Jun 25, 2026
6e055f5
Fix: Avoid hangs in fast_fallback tests under scheduling jitter (#17889)
shioimm Jul 16, 2026
0117f71
win32: Remove dead Windows CE guard
hsbt Jul 15, 2026
87506bb
win32: Remove DEC Alpha AXP detection from setup.mak
hsbt Jul 15, 2026
65c9345
win32: Reject MSVC older than 1900 at setup pass
hsbt Jul 15, 2026
7d02393
win32: Remove SuperH remnant from mkexports.rb
hsbt Jul 15, 2026
53dbc93
Remove obsolete -mno-cygwin flag
hsbt Jul 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ jobs:
env:
RUBY_TESTOPTS: '-q --tty=no'
TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''
RUBY_DEBUG_TEST_NO_REMOTE: "1"
PRECHECK_BUNDLED_GEMS: 'no'
LAUNCHABLE_STDOUT: ${{ steps.launchable.outputs.stdout_report_path }}
LAUNCHABLE_STDERR: ${{ steps.launchable.outputs.stderr_report_path }}
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Note: We're only listing outstanding class updates.

* `Array#pack` accepts new formats `R` and `r` for unsigned and signed
LEB128 encoded integers. [[Feature #21785]]
* `Array#pack` accepts new formats `x!` and `@!` to align the current
offset to a byte boundary or to the ABI alignment of another
directive. [[Feature #22185]]

* ENV

Expand Down Expand Up @@ -61,6 +64,11 @@ Note: We're only listing outstanding class updates.
ineffect inside its body, without affecting the original Proc.
[[Feature #22097]]

* Range

* `Range#clamp` is added. It returns a new `Range` instance whose
begin and end values are clamped to the given bounds. [[Feature #22175]]

* Regexp

* All instances of `Regexp` are now frozen, not just literals.
Expand All @@ -79,6 +87,9 @@ Note: We're only listing outstanding class updates.
* `String#unpack` and `String#unpack1` accept a new format `^` that
returns the current offset. Useful when combined with variable
width formats like LEB128. [[Feature #21796]]
* `String#unpack` and `String#unpack1` accept new formats `x!` and
`@!` to align the current offset to a byte boundary or to the ABI
alignment of another directive. [[Feature #22185]]

* Symbol

Expand Down Expand Up @@ -239,6 +250,8 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
[Feature #21981]: https://bugs.ruby-lang.org/issues/21981
[Feature #22137]: https://bugs.ruby-lang.org/issues/22137
[Feature #22139]: https://bugs.ruby-lang.org/issues/22139
[Feature #22175]: https://bugs.ruby-lang.org/issues/22175
[Feature #22185]: https://bugs.ruby-lang.org/issues/22185
[PR #17201]: https://github.com/ruby/ruby/pull/17201
[RubyGems-v4.0.4]: https://github.com/rubygems/rubygems/releases/tag/v4.0.4
[RubyGems-v4.0.5]: https://github.com/rubygems/rubygems/releases/tag/v4.0.5
Expand Down
47 changes: 47 additions & 0 deletions bootstraptest/test_ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,29 @@ def check obj1
end
}

# move preserves aliasing inside the moved object graph
assert_equal 'true', %q{
r = Ractor.new do
Ractor.receive
end

leaf = +"leaf"
moved = r.send([leaf, leaf], move: true).value
moved[0].equal?(moved[1])
}

# move handles cyclic references safely and preserves aliasing
assert_equal 'true', %q{
r = Ractor.new do
Ractor.receive
end

a = []
a << a
moved = r.send(a, move: true).value
moved.equal?(moved[0])
}

# unshareable frozen objects should still be frozen in new ractor after move
assert_equal 'true', %q{
r = Ractor.new do
Expand Down Expand Up @@ -2668,3 +2691,27 @@ def foo(a:, b:, c:) = super(a: a, b: b, c: c)
:ok # platform without fork
end
}

# A moved object's source is neutralized into a RactorMovedObject husk that
# stays in its original (possibly larger) slot. It must be given a shape whose
# slot size matches that slot, or a later compaction in the receiver trips the
# slot_size == shape_slot_size invariant (RGENGC_CHECK_MODE) / corrupts the slot.
assert_equal 'ok', %q{
r = Ractor.new do
while (o = Ractor.receive)
begin
GC.compact
rescue NotImplementedError
# no-op on platforms without GC.compact (e.g. MMTk)
end
end
:ok
end
500.times do
o = Object.new
12.times { |i| o.instance_variable_set("@i#{i}", i) } # overflow to a larger slot
r.send(o, move: true)
end
r.send(nil)
r.value
}
1 change: 0 additions & 1 deletion cygwin/GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ifeq ($(target_os),cygwin)
DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
VPATH := $(VPATH):$(srcdir)/win32
ifneq ($(filter -flto%,$(LDFLAGS)),)
miniruby$(EXEEXT): XLDFLAGS += -Wno-maybe-uninitialized
Expand Down
1 change: 0 additions & 1 deletion debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const union {
enum ruby_econv_flag_type econv_flag_types;
rb_econv_result_t econv_result;
enum ruby_preserved_encindex encoding_index;
enum ruby_robject_flags robject_flags;
enum ruby_rmodule_flags rmodule_flags;
enum ruby_rstring_flags rstring_flags;
enum ruby_rarray_flags rarray_flags;
Expand Down
26 changes: 26 additions & 0 deletions doc/language/packed_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,32 @@ for one byte in the input or output string.
"\x00\x00\x02".unpack("x4C") # Raises ArgumentError
```

- `'x!'` - Align to the given byte boundary or directive alignment;
for packing, null fill if necessary. With `buffer:` or `offset:`,
alignment is relative to the starting position:

```ruby
[1, 2].pack("C x!4 C") # => "\x01\x00\x00\x00\x02"
[1, 2].pack("C x!i i") # Aligns to the native int alignment.
```

For unpacking, skip forward to the aligned offset:

```ruby
"\x01\x00\x00\x00\x02".unpack("C x!4 C") # => [1, 2]
```

- `'@!'` - Align to the given byte boundary or directive alignment
from the beginning of the output or input string:

```ruby
buffer = +"z"
[1, 2].pack("C @!4 C", buffer: buffer)
buffer # => "z\x01\x00\x00\x02"

"z\x01\x00\x00\x02".unpack("C @!4 C", offset: 1) # => [1, 2]
```

- `'^'` - Only for unpacking; the current position:

```ruby
Expand Down
14 changes: 10 additions & 4 deletions ext/objspace/objspace_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,17 +591,23 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, "\"");
break;

case T_OBJECT:
if (!FL_TEST_RAW(obj, ROBJECT_HEAP)) {
case T_OBJECT: {
shape_id_t shape_id = RBASIC_SHAPE_ID(obj);

if (rb_shape_embedded_p(shape_id)) {
dump_append(dc, ", \"embedded\":true");
}

dump_append(dc, ", \"ivars\":");
dump_append_lu(dc, ROBJECT_FIELDS_COUNT(obj));
if (rb_obj_shape_complex_p(obj)) {
if (rb_shape_complex_p(shape_id)) {
dump_append_lu(dc, rb_st_table_size(rb_imemo_fields_complex_tbl(ROBJECT_FIELDS_OBJ(obj))));
dump_append(dc, ", \"complex_shape\":true");
}
else {
dump_append_lu(dc, RSHAPE_LEN(shape_id));
}
break;
}

case T_FILE:
fptr = RFILE(obj)->fptr;
Expand Down
Loading