87749 Commits

Author SHA1 Message Date
Samuel Williams
c50298d7d4
Introduce rb_io_blocking_region which takes struct rb_io argument. (#11795)
This does not change any actual behaviour, but provides a choke point for blocking IO operations.

* Update `IO::Buffer` to use `rb_io_blocking_region`.

* Update `File` to use `rb_io_blocking_region`.

* Update `IO` to use `rb_io_blocking_region`.
2024-10-05 15:10:12 +13:00
S-H-GAMELINKS
e766cb3e57 Suppress warnings in time_init_parse function
When building Ruby on Ubuntu 22.04 and GCC 11.4.0, the following warning appeared.
And this change has suppressed warning.

```
compiling ../ruby/time.c
../ruby/time.c: In function ‘time_init_parse’:
../ruby/time.c:2650:21: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
 2650 |         if (ndigits < TIME_SCALE_NUMDIGITS) {
      |                     ^
../ruby/time.c:2654:26: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
 2654 |         else if (ndigits > TIME_SCALE_NUMDIGITS) {
      |
```
2024-10-05 07:45:50 +09:00
tomoya ishida
563263a91c [ruby/reline] Concatenate some rendeing test
(https://github.com/ruby/reline/pull/749)

https://github.com/ruby/reline/commit/41b54140f4
2024-10-04 21:56:10 +00:00
Burdette Lamar
87169dd435
[DOC] Tweaks for Array#none? (#11788) 2024-10-04 16:11:10 -04:00
Burdette Lamar
b57bbf774f
[DOC] Tweaks for Array#one? (#11789) 2024-10-04 20:10:58 +00:00
Samuel Giddins
648f558e01 [rubygems/rubygems] Remove now unused realworld spec
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/2484267920
2024-10-04 20:01:57 +00:00
Samuel Giddins
b653be0ba5 [rubygems/rubygems] Update spec rubygems_ext
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/1ef33fa0af
2024-10-04 20:01:57 +00:00
Samuel Giddins
e472d1a6d6 [rubygems/rubygems] Remove extra space in BUNDLED WITH section
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/d8b5d05e46
2024-10-04 20:01:56 +00:00
Samuel Giddins
40d7e5d2ab [rubygems/rubygems] Update rubocop to ruby 3.1
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/300fb96ffc
2024-10-04 20:01:56 +00:00
Samuel Giddins
dfa11551aa [rubygems/rubygems] More rubygems 3.2.x removals
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/272f3464a3
2024-10-04 20:01:52 +00:00
Samuel Giddins
7695bf183b [rubygems/rubygems] Remove CorrectHashForLambdaOperator monkey patch
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/085bafd8d4
2024-10-04 20:01:52 +00:00
Samuel Giddins
db6e6155d6 [rubygems/rubygems] Remove outdated conditionals from tests
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/06eec6d855
2024-10-04 20:01:51 +00:00
Samuel Giddins
bdc3363d0f [rubygems/rubygems] Update required_ruby_version to 3.1
3.0 has been EOL since march, drop support for it before the 3.4 release is cut

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/fc1f03b06a
2024-10-04 20:01:51 +00:00
Kevin Newton
30038656aa Fix intermediate array off-by-one error
Co-authored-by: Adam Hess <HParker@github.com>
2024-10-04 15:04:26 -04:00
Peter Zhu
f77517f473 [DOC] Minor adjustment for Array#min 2024-10-04 13:36:36 -04:00
Peter Zhu
c7dc7da2ee [DOC] Minor adjustment for Array#max 2024-10-04 13:35:56 -04:00
Burdette Lamar
95ad0e5f85
[DOC] Tweaks for Array#minmax (#11787) 2024-10-04 17:34:11 +00:00
Kevin Newton
5a95a69058 [ruby/prism] Fix up pattern parsing with trailing commas
https://github.com/ruby/prism/commit/51f2df60ff
2024-10-04 17:01:58 +00:00
Kevin Newton
75640037bf [ruby/prism] Fix up multi target parsing
https://github.com/ruby/prism/commit/80cd335222
2024-10-04 16:22:21 +00:00
Peter Zhu
cd86393ad8 Assume VM locked in rb_mark_generic_ivar
rb_gen_ivtbl_get locks the VM, but the VM must be locked during marking
so we can directly read from the generic_ivtbl without locking the VM.
2024-10-04 08:50:43 -04:00
Nobuyoshi Nakada
79a8750ade
[Bug #20783] Insert a space between RPATHFLAG and LIBPATHFLAG 2024-10-04 18:49:47 +09:00
Samuel Williams
86e8a36e77
Revert "Direct access to fptr->fd should prefer to use the internal/io.h. (#11793)"
This reverts commit 6ea0dcc9781931129e77540097712f6196d49fde that was accidentally merged.
2024-10-04 08:25:43 +00:00
Samuel Williams
6ea0dcc978
Direct access to fptr->fd should prefer to use the internal/io.h. (#11793) 2024-10-04 07:44:23 +00:00
Samuel Williams
c33cb9a586
Update io_spec.c to use rb_io_maybe_wait* if possible. (#11792) 2024-10-04 07:35:57 +00:00
Samuel Williams
c878843b2c
Better handling of timeout in rb_io_maybe_wait_*. (#9531) 2024-10-04 19:36:06 +13:00
Samuel Williams
96d69d2df2
Clarify rb_io_maybe_wait behaviour. (#9527) 2024-10-04 18:40:38 +13:00
dependabot[bot]
939ec9f080 Bump github/codeql-action from 3.26.10 to 3.26.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.10 to 3.26.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e2b3eafc8d...6db8d6351f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-04 12:22:53 +09:00
Hiroshi SHIBATA
c5b1df7524 Skip related tests in PathnameInstanceTest 2024-10-04 12:21:27 +09:00
schneems
3c54b8e920 Allow method chaining with Pathname#mkpath
Currently in my code when I want to create a pathname object and create a path at the same time I must use tap

```
path = Pathname.new("/tmp/new").tap(&:mkpath)
```

I think it would be cleaner to be able to chain on the results of these methods instead:

```
path = Pathname.new("/tmp/new").mkpath
```
2024-10-04 12:21:27 +09:00
schneems
08346e7267 Introduce Pathname.mktmpdir
When I want to create a tmpdir I often want to manipulate it as a pathname. By introducing Pathname.mktmpdir I can get this behavior. 

Currently I must:

```ruby
Dir.mktmpdir do |dir|
  dir = Pathname(dir)
  # ... code
end
```

I would like to be able to instead:

```ruby
Pathname.mktmpdir do |dir|
  # ... code
end
```
2024-10-04 11:15:33 +09:00
Peter Zhu
e90862f0ed [DOC] Correct documentation for Array#max
The return value of Array#max is the maximum value per the block, not
from the block.
2024-10-03 17:02:52 -04:00
Burdette Lamar
3ece042c38
[DOC] Tweaks for Array#min (#11786) 2024-10-03 21:02:32 +00:00
Matt Valentine-House
8e7df4b7c6 Rename size_pool -> heap
Now that we've inlined the eden_heap into the size_pool, we should
rename the size_pool to heap. So that Ruby contains multiple heaps, with
different sized objects.

The term heap as a collection of memory pages is more in memory
management nomenclature, whereas size_pool was a name chosen out of
necessity during the development of the Variable Width Allocation
features of Ruby.

The concept of size pools was introduced in order to facilitate
different sized objects (other than the default 40 bytes). They wrapped
the eden heap and the tomb heap, and some related state, and provided a
reasonably simple way of duplicating all related concerns, to provide
multiple pools that all shared the same structure but held different
objects.

Since then various changes have happend in Ruby's memory layout:

* The concept of tomb heaps has been replaced by a global free pages list,
  with each page having it's slot size reconfigured at the point when it
  is resurrected
* the eden heap has been inlined into the size pool itself, so that now
  the size pool directly controls the free_pages list, the sweeping
  page, the compaction cursor and the other state that was previously
  being managed by the eden heap.

Now that there is no need for a heap wrapper, we should refer to the
collection of pages containing Ruby objects as a heap again rather than
a size pool
2024-10-03 21:20:09 +01:00
Matt Valentine-House
b58a364522 Inline eden_heap into size_pool
After the individual tomb_heaps were removed in favour of a global list
of empty pages, the only instance of rb_heap_t left is the eden_heap
within each size pool.

This PR inlines the heap fields directly into rb_size_pool_t to remove
indirection and remove the SIZE_POOL_EDEN_HEAP macro
2024-10-03 21:20:09 +01:00
Peter Zhu
cd71fa96ac Remove else case for shared-gc make target 2024-10-03 15:45:03 -04:00
Kevin Newton
568511f393 [ruby/prism] Handle single global variable character name
https://github.com/ruby/prism/commit/7a0af49997
2024-10-03 17:43:11 +00:00
Kevin Newton
f8568fbd7f [ruby/prism] Pop lex mode for heredocs in the lexer, not the parser
https://github.com/ruby/prism/commit/5dd36b979e
2024-10-03 17:30:20 +00:00
Peter Zhu
77db37813a Fix indentation in test_after_gc_start_hook_with_GC_stress 2024-10-03 11:58:20 -04:00
tomoya ishida
ac0a8c6230 [ruby/reline] Make rendering test faster using updated yamatanooroti
(https://github.com/ruby/reline/pull/747)

https://github.com/ruby/reline/commit/7534f7f92a
2024-10-03 15:52:34 +00:00
Jeremy Evans
9986a7c393 Make Object#singleton_method return methods in modules included in or prepended to singleton class
To simplify the implementation, this makes Object#singleton_method
call the same method called by Object#method (rb_obj_method), then
check that the returned Method is defined before the superclass of the
object's singleton class.  To keep the same error messages, it rescues
exceptions raised by rb_obj_method, and then raises its own exception.

Fixes [Bug #20620]
2024-10-03 07:27:01 -07:00
Peter Zhu
dc83de4928 [DOC] Add missing word 2024-10-03 09:28:13 -04:00
Peter Zhu
f56be4286f [DOC] Add pound sign before all <=> methods 2024-10-03 09:28:13 -04:00
Earlopain
66124cdb17 [ruby/prism] Use partial_script for the parser translators
Followup to https://github.com/ruby/prism/pull/3079

https://github.com/ruby/prism/commit/68f434e356
2024-10-03 12:52:02 +00:00
Samuel Williams
cd96af2cb8
Add IO::Buffer tests for read and write with length & offset. (#11779) 2024-10-03 12:29:16 +00:00
tomoya ishida
218445bb1f [ruby/rdoc] Fix ToRdoc#accept_table
(https://github.com/ruby/rdoc/pull/1184)

https://github.com/ruby/rdoc/commit/7b68545094
2024-10-03 12:27:43 +00:00
Matt Valentine-House
b421964b9d Remove unused macros 2024-10-03 12:49:24 +01:00
Nobuyoshi Nakada
9d4af312bd [ruby/reline] Rename matches? as match?
(https://github.com/ruby/reline/pull/753)

https://github.com/ruby/reline/commit/9230fe162d
2024-10-03 10:38:38 +00:00
tompng
5bf8a53063 Specify commit hash of debug in bundled_gems 2024-10-03 18:47:09 +09:00
tompng
c94815bab7 Update spec/ruby/ for colon-style hash inspect 2024-10-03 18:47:09 +09:00
tompng
af1c356c7b Update default gem test for colon-style hash inspect 2024-10-03 18:47:09 +09:00