8242477: (bf) MappedByteBuffer should clarify copying between overlapping mappings

Brian Burkhalter brian.burkhalter at oracle.com
Mon Apr 13 15:50:27 UTC 2020



> On Apr 13, 2020, at 8:49 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 13/04/2020 16:42, Brian Burkhalter wrote:
>> 
>>> On Apr 11, 2020, at 4:23 AM, Florian Weimer <fw at deneb.enyo.de <mailto:fw at deneb.enyo.de>> wrote:
>>> 
>>> In principle, this also applies to direct buffer created via JNI's
>>> NewDirectByteBuffer.  Such direct buffers could alias with each other
>>> or even MappedByteBuffer instances.
>> 
>> Indeed. And in an even simpler case, two different views of the same direct buffer could produce unexpected results with a relative bulk put from one into the other.
>> 
> Yes, it's a good point.

I verified it with a small test.

> Can you check out whether the statement could be added to the BB "Direct vs. non-direct buffer" sections.

Sure.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200413/c132e925/attachment.htm>


More information about the nio-dev mailing list