Skip to content

Preserve returned read buffer ownership - #72

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/returned-buffer-ownership-protocol
Open

Preserve returned read buffer ownership#72
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/returned-buffer-ownership-protocol

Conversation

@OskarEichler

Copy link
Copy Markdown

BufferedIO appends a String returned by read_nonblock and then clears that returned object. A custom/nonstandard IO that retains the returned String observes unexpected caller-side mutation, even though BufferedIO only needs its copied bytes. Removing the redundant clear preserves ownership and output.

The external ownership model fails on current master and passes after this change on Ruby 4.0.6 and 3.2.11. The unchanged suite passes 30 tests / 66 assertions on both Rubies; syntax and diff checks pass. No repository tests were changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant