Age | Commit message (Collapse) | Author |
|
#set_string (#11640)
The current implementation of `IO::Buffer#copy` and `#set_string` has
an undefined behavior when the source and destination memory overlaps,
due to the underlying use of the `memcpy` C function.
This patch guarantees the methods to be safe even when copying between
overlapping buffers by replacing `memcpy` with `memmove`,
Fixes: [Bug #20745]
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11738
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11735
|
|
(#9532)
This makes the behaviour of IO::Buffer.new(0) and IO::Buffer.new.slice(0, 0) consistent.
Fixes https://bugs.ruby-lang.org/issues/19542 and https://bugs.ruby-lang.org/issues/18805.
|
|
* Don't return early.
* Add missing `mapping` assignment.
* Make debug logs conditional.
|
|
Run this test separately because something seems remained unreleased
on Windows.
|
|
* Avoiding using `Tempfile` which was retaining the file preventing it from unlinking.
|
|
* Restore experimental warnings.
* Documentation and code structure improvements.
* Improved validation of flags, clarified documentation of argument handling.
* Remove inconsistent use of `Example:` and add example to `null?`.
* Expose `IO::Buffer#private?` and add test.
|
|
* Raise TypeError when IO::Buffer.map argument is neither IO nor implements #fileno
* Use UNREACHABLE_CODE
Co-authored-by: Nobuyoshi Nakada <[email protected]>
* Use macro for undef check
Co-authored-by: Nobuyoshi Nakada <[email protected]>
---------
Co-authored-by: Nobuyoshi Nakada <[email protected]>
|
|
String locking with locktmp is not really part of the public API,
and the test relies in a side effect of using it to protect the
buffer. On other implementations without locktmp this does not
fail. Separate into its own test so it can be excluded from public
API expectations.
|
|
* Fix `io_buffer_get_string` default length computation.
When an offset bigger than the size is given, the resulting length will be
computed incorrectly. Raise an argument error in this case.
* Validate all arguments.
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
- Fix IO::Buffer `read`/`write` to use a minimum length.
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
`#resize(0)` on an IO::Buffer with internal buffer allocated will
result in calling `realloc(data->base, 0)`. The behavior of `realloc`
with size = 0 is implementation-defined (glibc frees the object
and returns NULL, while BSDs return an inaccessible object). And
thus such usage is deprecated in standard C (upcoming C23 will make it
UB).
To avoid this problem, just `free`s the memory when the new size is zero.
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
`pwrite`. (#7012)
Notes:
Merged-By: ioquatix <[email protected]>
|
|
There is currently a bug ([#19084]) in how extended strings work in
IO Buffers. Object Shapes changes will make the string in this test
extended on 32 bit machines. Since this behavior is currently broken
(unrelated to object shapes) on 32 bit machines, this test will then
fail. We preemptively omit it so that this commit can be reverted
once the bug is fixed.
Notes:
Merged: https://github.com/ruby/ruby/pull/6699
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5249
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5314
Merged-By: ioquatix <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5303
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5301
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5300
|
|
As this warning is emitted just once per processes, needs in each
files when parallel testing.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5115
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5109
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/5109
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4621
|