On other platforms, RUBY_SO_NAME is defined from RUBY_API_VERSION.
ruby_version contains the ABI version, which is not needed.
RUBY_API_VERSION is defined as MAJOR.MINOR.
If the block only accepts a single positional argument plus keywords,
then do not autosplat. Still autosplat if the block accepts more
than one positional argument in addition to keywords.
Autosplatting a single positional argument plus keywords made sense
in Ruby 2, since a final positional hash could be used as keywords,
but it does not make sense in Ruby 3.
Fixes [Bug #18633]
Currently, the number of incremental marking steps is calculated based
on the number of pooled pages available. This means that if we make Ruby
heap pages larger, it would run fewer incremental marking steps (which
would mean each incremental marking step takes longer).
This commit changes incremental marking to run after every
INCREMENTAL_MARK_STEP_ALLOCATIONS number of allocations. This means that
the behaviour of incremental marking remains the same regardless of the
Ruby heap page size.
I've benchmarked against discourse benchmarks and did not get a
significant change in response times beyond the margin of error. This is
expected as this new incremental marking algorithm behaves very
similarly to the previous one.
Method references is not only able to be marked up as code, also
reflects `--show-hash` option.
The bug that prevented the old rdoc from correctly parsing these
methods was fixed last month.
This is more backwards compatible, and should fix issues with
power_assert.
Unfortunately, it requires using a sentinel value as the default
value of target_thread, instead of the more natural expression
used in the original approach.
If TracePoint#enable is passed a block, it previously started
the trace on all threads. This changes it to trace only the
current thread by default. To limit the scope of the change,
the current thread is only used by default if target and
target_line are both nil. You can pass target_thread: nil
to enable tracing on all threads, to get the previous
default behavior.
Fixes [Bug #16889]
I have this scripts that deadlocks after about
5 minutes if I repeatedly run it with a shell loop:
```ruby
$VERBOSE = nil
lamb = ->(main, gc) do
gc.verify_internal_consistency
gc.verify_internal_consistency
main << 1
gc.verify_internal_consistency
gc.verify_internal_consistency
main << 2
gc.verify_internal_consistency
gc.verify_internal_consistency
main << 3
gc.verify_internal_consistency
gc.verify_internal_consistency
end
lamb[[], GC]
lamb[[], GC]
r = Ractor.new Ractor.current, GC, &lamb
a = []
a << Ractor.receive_if{|msg| msg == 2}
a << Ractor.receive_if{|msg| msg == 3}
a << Ractor.receive_if{|msg| msg == 1}
```
Shell loop:
```shell
while ./miniruby deadlock.rb; do date; done
```
Once it locks up, CTRL-C doesn't interrupt the process which
led me to infer `receive_if` is looping in `ractor_receive_if()`
without checking for interrupts. This can be confirmed by
attaching a debugger to the deadlocked miniruby.
The deadlock has one thread looping in `receive_if`
and another waiting in `rb_vm_barrier()`. The barrier relies
on interrupt checking to finish. Theoretically speaking the
`rb_vm_barrier()` could come from one thread naturally starting GC.
We found this while developing YJIT but it dead locks running
with YJIT disabled. YJIT currently relies on `rb_vm_barrier()`
to synchronize before changing memory protection.
This diff adds an interrupt check in the loop in `Ractor#receive_if`
which seems to fix the deadlock.
In addition, this commit allows interrupting the following single
ractor script with CTRL-C.
```shell
ruby -e 'Ractor.current.send(3); Ractor.receive_if { false }'
```
WHen libyaml is not installed, make fails with the following cryptic
message:
```
gmake[2]: Entering directory '/home/chkbuild/chkbuild-crossruby/tmp/build/20220325T045825Z/ruby/ext/psych'
gmake[2]: *** No rule to make target 'yaml/yaml.h', needed by 'psych.o'. Stop.
gmake[2]: Leaving directory '/home/chkbuild/chkbuild-crossruby/tmp/build/20220325T045825Z/ruby/ext/psych'
```
I think it should give up building psych with a clear message.