| Age | Commit message (Collapse) | Author |
|
io.c: pre-allocate IO.select result arrays based on input size
The ternary (rp?rb_ary_new():rb_ary_new2(0)) became pointless after
commit a51f30c671 (Variable Width Allocation, Mar 2022) made both
rb_ary_new() and rb_ary_new2(0) equivalent.
Instead of just removing the dead code, improve on the original intent
by pre-allocating based on the actual input array size. This avoids
reallocations when many FDs are ready.
Benchmark (100 ready FDs): ~8% improvement (5.59 -> 5.11 us/op)
|
|
|
|
[Feature #19630]
This dangerous behavior was removed in 4.0 (996cae65f3cc8fed60c6bb758b00882cac49389d)
but the documentation wasn't updated.
|
|
This appears to be a workaround for Windows XP behavior. It is unnecessary now.
|
|
Previously, calling IO#flush or closing an IO with unflushed buffered
writes would just invoke `#blocking_operation_wait` and flush the write
buffer using a `write` syscall. This change adds flushing through the
fiber scheduler by invoking the `#io_write` hook.
* Prefer IO::Buffer#write in IOScheduler
* Use Dir.tmpdir for test file
* Correctly handle errors in io_flush_buffer_fiber_scheduler
|
|
The changes are to `io.c` and `thread.c`.
I changed the API of 2 exported thread functions from `internal/thread.h` that
didn't look like they had any use in C extensions:
* rb_thread_wait_for_single_fd
* rb_thread_io_wait
I didn't change the following exported internal function because it's
used in C extensions:
* rb_thread_fd_select
I added a comment to note that this function, although internal, is used
in C extensions.
|
|
|
|
Fix io_pwrite fiber scheduler hook.
|
|
|
|
Re-organize page docs
|
|
[Bug #21703]
RUBY_CRASH_REPORT does not work in some cases when shelling out on Linux.
For example, given the following shell script dump.sh:
#!/usr/bin/env bash
cat > /tmp/crash
And we see it fails like this:
$ RUBY_CRASH_REPORT="|dump.sh" ruby -rfiddle -e "Fiddle::Pointer.new(1, 10)[0]"
cat: -: Resource temporarily unavailable
|
|
|
|
|
|
|
|
|
|
Fixes [Bug #21635]
|
|
|
|
Using IO#each_codepoint together with IO#ungetc causes an unwanted exception when encoding conversion is active.
C:\>ruby -e "open('NUL', 'rt') { |f| f.ungetc('aa'); f.each_codepoint { |c| p c }}"
97
-e:1:in 'IO#each_codepoint': byte oriented read for character buffered IO (IOError)
from -e:1:in 'block in <main>'
from -e:1:in 'Kernel#open'
from -e:1:in '<main>'
Fixes [Bug #21131]
|
|
ARGF supports compaction, but it pins all of its references, which means
that none of it can move. This commit changes it to actually support
compaction.
|
|
|
|
|
|
|
|
It is `exitstatus`, not `status`, per https://github.com/ruby/ruby/blob/3d5619c8b1a76626e0991d758b71afc549829c38/process.c#L581
|
|
(#13359)
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
- `rb_thread_fd_close` is deprecated and now a no-op.
- IO operations (including close) no longer take a vm-wide lock.
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
matz accepted at the developper meeting 2024-07-11.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13021
|
|
[Feature #21109]
By always freezing when setting the global rb_rs variable, we can ensure
it is not modified and can be accessed from a ractor.
We're also making sure it's an instance of String and does not have any
instance variables.
Of course, if $/ is changed at runtime, it may cause surprising behavior
but doing so is deprecated already anyway.
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/12975
|
|
[Bug #21195]
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Otherwise, changes to the buffer by the destination write method
could result in data changing for supposedly independent strings.
Fixes [Bug #21131]
Notes:
Merged: https://github.com/ruby/ruby/pull/12771
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12497
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12496
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12496
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12304
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12023
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12022
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11811
|
|
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`.
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11690
|
|
Co-Authored-By: Martin Dorey <martin.dorey@hds.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/11537
|
|
|
|
[DOC] IO.select accepts a numeric value as timeout, not only an integer.
|