Граф коммитов

71721 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 9f306618b1 [Bug #18667] Define RUBY_API_VERSION on Windows
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.
2022-03-30 18:08:46 -04:00
Burdette Lamar 0cb43034b4
Repair format for What's Here in Dir (#5737) 2022-03-30 14:14:36 -05:00
Burdette Lamar ffcdbedbfb
Repaired What's Here sections for Range, String, Symbol, Struct (#5735)
Repaired What's Here sections for Range, String, Symbol, Struct.
2022-03-30 13:46:24 -05:00
Jeremy Evans 79b59fee16 Update NEWS for proc autosplat change 2022-03-30 11:39:27 -07:00
git 0dd63216e3 * 2022-03-31 [ci skip] 2022-03-31 03:04:18 +09:00
Jeremy Evans fbaadd1cfe
Do not autosplat array in block call just because keywords accepted
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]
2022-03-30 11:03:56 -07:00
Nobuyoshi Nakada 75efbb98af [ruby/psych] Propagate the host configuration to libyaml
https://github.com/ruby/psych/commit/0e37e19707
2022-03-30 23:08:13 +09:00
Peter Zhu dde164e968 Decouple incremental marking step from page sizes
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.
2022-03-30 09:33:17 -04:00
Yusuke Endoh ad808506b3 Update dependencies 2022-03-30 16:50:46 +09:00
Yusuke Endoh 5df2589b64 internal/ractor.h: Added
Currently it has only one function prototype.
2022-03-30 16:50:46 +09:00
Yusuke Endoh 2ade40276b re.c: raise Regexp::TimeoutError instead of RuntimeError 2022-03-30 16:50:46 +09:00
Yusuke Endoh 34b288f8d4 doc/regexp.rdoc: Add explanation about Regexp timeout configuration 2022-03-30 16:50:46 +09:00
Yusuke Endoh ce87bb8bd6 re.c: Add `timeout` keyword for Regexp.new and Regexp#timeout 2022-03-30 16:50:46 +09:00
Yusuke Endoh ffc3b37f96 re.c: Add Regexp.timeout= and Regexp.timeout
[Feature #17837]
2022-03-30 16:50:46 +09:00
Yusuke Endoh 23530d68cb ractor.c: Add a helper function to ensure the context is a main ractor 2022-03-30 16:50:46 +09:00
Yusuke Endoh a94002115b thread.c: Move double2hrtime and hrtime2double to hrtime.h
... to make them available in other places than thread.c
2022-03-30 16:50:46 +09:00
Nobuyoshi Nakada 42a0bed351
Prefix ccan headers (#4568)
* Prefixed ccan headers

* Remove unprefixed names in ccan/build_assert

* Remove unprefixed names in ccan/check_type

* Remove unprefixed names in ccan/container_of

* Remove unprefixed names in ccan/list

Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
2022-03-30 20:36:31 +13:00
Nobuyoshi Nakada 8d27d00af5
Fix locations of the second argument 2022-03-30 14:38:33 +09:00
Nobuyoshi Nakada 71aa43c725 [ruby/psych] Configure libyaml from the original source
https://github.com/ruby/psych/commit/54a9ba9d10
2022-03-30 11:31:04 +09:00
Nobuyoshi Nakada 0bca029d2f
[DOC] Use simple references to operator methods
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.
2022-03-30 10:54:52 +09:00
Jeremy Evans 5d43969e92 Update NEWS for TracePoint#enable target_thread default change 2022-03-29 18:33:16 -07:00
Jeremy Evans 3cad54a246 Fix comment 2022-03-29 18:14:33 -07:00
Jeremy Evans d8dfabbfe6 Fix spec description
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2022-03-29 18:14:33 -07:00
Jeremy Evans 750e18594b Update comment for TracePoint#enable
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2022-03-29 18:14:33 -07:00
Jeremy Evans 3c6a0033e3 Avoid trace events in implementation of TracePoint#enable
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.
2022-03-29 18:14:33 -07:00
Jeremy Evans 9c1d32a7ad Make TracePoint#enable with block target current thread by default
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]
2022-03-29 18:14:33 -07:00
Jeremy Evans 6d3f447aec Fix multiplex backreferencs near end of string in regexp match
Idea from Jirka Marsik.

Fixes [Bug #18631]
2022-03-29 15:29:15 -07:00
Jeremy Evans 173a6b6a80 Make define_singleton_method always define a public method
In very unlikely cases, it could previously define a non-public method
starting in Ruby 2.1.

Fixes [Bug #18561]
2022-03-29 12:10:13 -07:00
git f3b58e1d38 * 2022-03-30 [ci skip] 2022-03-30 00:21:28 +09:00
Jemma Issroff 87123c4fc7 Refactor test_dump_all to make assertions about the contents of the dumped hash 2022-03-29 08:21:10 -07:00
Burdette Lamar b257034ae5
[DOC] Enhanced RDoc for String (#5730)
Treats:

    #start_with?
    #end_with?
    #delete_prefix
    #delete_prefix!
    #delete_suffix
    #delete_suffix!
2022-03-29 09:54:29 -05:00
Nobuyoshi Nakada c67088dbae [ruby/psych] Try bundled libyaml source if pre-installed is unavailable
https://github.com/ruby/psych/commit/f78e1dba89
2022-03-29 20:57:58 +09:00
Burdette Lamar c8e1ae4db7
[DOC] Repair format of What's Here sections in object.c (#5722)
* Repair format of What's Here sections in object.c
2022-03-29 06:19:51 -05:00
Hiroshi SHIBATA 8e2a2ba0f9 Merge psych master
c386ecb0c2
2022-03-29 19:07:12 +09:00
Alan Wu 51e98eab1f
Fix Ractor.receive_if + rb_vm_barrier() deadlock
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 }'
```
2022-03-28 17:00:45 -04:00
Burdette Lamar 5525e47a0b
[DOC] Enhanced RDoc for String (#5726)
Treats:

    #ljust
    #rjust
    #center
    #partition
    #rpartition
2022-03-28 15:49:18 -05:00
git 79bd12a6e4 * 2022-03-29 [ci skip] 2022-03-29 00:48:04 +09:00
Benoit Daloze 8db4f25bf4 Update to ruby/spec@aaf998f 2022-03-28 17:47:04 +02:00
Peter Zhu ae650f0372 Remove unneeded function declarations in gc.c 2022-03-28 10:02:45 -04:00
Nobuyoshi Nakada 035b75c8f4
Update zlib version to 1.2.12 2022-03-28 17:28:01 +09:00
Nobuyoshi Nakada 5568cd5a55
Fix a missing comma 2022-03-28 17:02:02 +09:00
Nobuyoshi Nakada 152bb3c0b4
Use m4 comments outside macros in m4 files 2022-03-28 17:01:28 +09:00
Nobuyoshi Nakada 2cb3efffcf
Extract RUBY_REQUIRE_FUNCS 2022-03-28 16:56:15 +09:00
Nobuyoshi Nakada 282baa6943
[DOC] Move the entry for [Feature #18571] 2022-03-28 15:03:41 +09:00
Kazuhiro NISHIYAMA 4e580bd67a
Fix a link [ci skip] 2022-03-28 10:59:35 +09:00
Hiroshi SHIBATA c3555e3da4
Added entry of Psych changes for #18571 2022-03-28 10:43:10 +09:00
git 63f6dce09e * 2022-03-28 [ci skip] 2022-03-28 04:45:31 +09:00
Burdette Lamar d52cf1013f
[DOC] Enhanced RDoc for String (#5724)
Treats:

    #scan
    #hex
    #oct
    #crypt
    #ord
    #sum
2022-03-27 14:45:14 -05:00
Yusuke Endoh ca85f16a7d ext/psych/extconf.rb: Fail when libyaml is unavailable
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.
2022-03-27 19:34:07 +09:00
Nobuyoshi Nakada 1b0f05168d
[DOC] Fix references to unary operator 2022-03-27 11:24:06 +09:00