Skip to content

Undo shared-buffer optimizations from #6557#6769

Merged
headius merged 1 commit intojruby:jruby-9.2from
headius:deoptimize_iochannel_write
Aug 5, 2021
Merged

Undo shared-buffer optimizations from #6557#6769
headius merged 1 commit intojruby:jruby-9.2from
headius:deoptimize_iochannel_write

Conversation

@headius
Copy link
Member

@headius headius commented Aug 5, 2021

The "optimizations" in #6557 were overzealous:

  • The incoming ByteBuffer and its contents should not be
    referenced past the end of the call, as was done here by
    returning a String that directly wraps the buffer's underlying
    array.
  • The copy of bytes out of the native buffer is essentially the
    same as calling #duplicate, so this is just unnecessary double-
    copying.

Fixes #6767.

The "optimizations" here were overzealous:

* The incoming ByteBuffer and its contents should not be
  referenced past the end of the call, as was done here by
  returning a String that directly wraps the buffer's underlying
  array.
* The copy of bytes out of the native buffer is essentially the
  same as calling #duplicate, so this is just unnecessary double-
  copying.

Fixes jruby#6767.
@headius headius added this to the JRuby 9.2.20.0 milestone Aug 5, 2021
@headius headius merged commit 7e845c5 into jruby:jruby-9.2 Aug 5, 2021
@headius headius deleted the deoptimize_iochannel_write branch August 5, 2021 18:00
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