summaryrefslogtreecommitdiff
path: root/test/ruby/test_io_buffer.rb
AgeCommit message (Collapse)Author
2024-10-18merge revision(s) 35e124832e29b65c84d4e0e4e434616859f9bdf5: [Backport #20755]nagachika
[Bug #20755] Frozen string should not be writable via IO::Buffer
2024-10-18merge revision(s) 637067440f74043c6d79fc649ab8acf1afea25a5: [Backport #20752]nagachika
[Bug #20752] Slice of readonly `IO::Buffer` also should be readonly
2024-10-04Add `IO::Buffer` tests for read and write with length & offset.Samuel Williams
2024-05-18Fix `io_buffer_get_string` default length computation. (#8427)Samuel Williams
* 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.
2024-05-18Improvements to `IO::Buffer` `read`/`write`/`pread`/`pwrite`. (#7826)Samuel Williams
- Fix IO::Buffer `read`/`write` to use a minimum length.
2023-10-28merge revision(s) 19346c2336053b351673da030b00c704138252d8: [Backport #19754]nagachika
[Bug #19754] Make `IO::Buffer#get_string` check `offset` range (#8016) --- io_buffer.c | 3 +++ test/ruby/test_io_buffer.rb | 8 ++++++++ 2 files changed, 11 insertions(+)
2023-07-16merge revision(s) bd786e78969f9d4a8699376ceafe10934b6ad533: [Backport #19084]nagachika
Fix mutation on shared strings. (#7837) --- io_buffer.c | 19 ++++++++++++------- test/ruby/test_io_buffer.rb | 4 ---- 2 files changed, 12 insertions(+), 11 deletions(-)
2023-07-16merge revision(s) 09295ea796900fb7b05d29e93364090e21598566: [Backport #19543]nagachika
IO::Buffer#resize: Free internal buffer if new size is zero (#7569) `#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. --- io_buffer.c | 5 +++++ test/ruby/test_io_buffer.rb | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+)
2022-12-24Fix missing handling of offset argument in `IO::Buffer` `pread` and ↵Samuel Williams
`pwrite`. (#7012) Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-11-10Omit test on IO Buffers which relies on String being embeddedJemma Issroff
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
2022-10-19Add support for anonymous shared IO buffers. (#6580)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-12Improvements to IO::Buffer implementation and documentation. (#6525)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-09-26Add several new methods for getting and setting buffer contents. (#6434)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-10Fix the order of assert_eqaul and remove unused variablesNobuyoshi Nakada
2022-05-09Add basic binary operators (and, or, xor, not) to `IO::Buffer`. (#5893)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-05-09Explicit handling of frozen strings in `IO::Buffer#for`. (#5892)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2021-12-23Add fiber scheduler hooks for `pread`/`pwrite`, and add support to `IO::Buffer`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5249 Merged-By: ioquatix <samuel@codeotaku.com>
2021-12-22Extended interface for IO::Buffer & documentation.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5314 Merged-By: ioquatix <samuel@codeotaku.com>
2021-12-21Rename IMMUTABLE to READONLY.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Improve interface for get/set/copy.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Mark non-private mapped files as external.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Default `IO::Buffer#get_string` to use BINARY encoding.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Add tests for `IO::Buffer` `get`/`set`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Rename `to_str` -> `get_string` and add support for encodings.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Improved exception usage/classes.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Fix handling of frozens strings.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-21Fix mapping invalid non-file object.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5303
2021-12-20Improve IO::Buffer resize and introduce ownership transfer.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5301
2021-12-19Default size for IO::Buffer.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5300
2021-11-23Suppress the “experimental" warnings for `IO::Buffer`Nobuyoshi Nakada
As this warning is emitted just once per processes, needs in each files when parallel testing.
2021-11-17Validate string type when constructing IO::Buffer for string mapping.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5115
2021-11-12Rework implementation of `IO::Buffer.for(string)` to use string locking.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5109
2021-11-12More immutability and locking tests.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5109
2021-11-10IO::Buffer for scheduler interface.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4621