summaryrefslogtreecommitdiff
path: root/test/ruby/test_stack.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2022-12-07 16:37:09 +0100
committergit <svn-admin@ruby-lang.org>2022-12-08 07:17:51 +0000
commit8547f61dafa1ea1a18b6f823320e3fcf97e1a156 (patch)
tree2b2d9c39090fc11d2e4dc54ec74260bd6e8fbf26 /test/ruby/test_stack.rb
parenta57a3154d3e11b347ecde7b86a656d0c0737169e (diff)
[ruby/net-protocol] Undo BufferedIO#rbuf_consume_all_shareable! optimization
This optimization is unsafe because `dest` is allowed to be a custom object responding to `<<` (e.g. a block wrapped in `ReadAdapter`). So the receiver can hold onto the passed buffer for as long as it wants. If it was guaranteed that `ReadAdapter` was the only possible receiver we could dup the buffer there for mutation safety, but I'm not certain it's the case so I'd rather err on the safe side. Ref: https://github.com/shrinerb/shrine/issues/610 https://github.com/ruby/net-protocol/commit/7efa16d55d
Diffstat (limited to 'test/ruby/test_stack.rb')
0 files changed, 0 insertions, 0 deletions