RFR: 8207851 JEP Draft: Support ByteBuffer mapped over non-volatile memory

Andrew Dinn adinn at redhat.com
Wed Feb 20 11:28:47 UTC 2019


On 20/02/2019 11:11, Alan Bateman wrote:
> On 19/02/2019 18:01, Andrew Dinn wrote:
>> :
>> My reason for using capacity() was that I was swayed by the original
>> implementation of force(). It calls
>>
>>    force0(fd, mappingAddress(offset), mappingLength(offset))
>>
>> :
>>
>> I'm wondering if this ought to remain as is or ought to change to
>> specify limit()?
>>
> The no-arg force method is specified to force any changes to the buffer
> content to be written so I don't think it needs to change. We could
> clarify the spec on this point but I don't think it is strictly needed.
Ok, thanks.

So, in the next webrev when force() with no args is called on a non-SYNC
mode buffer I will ensure it continues to call

  force0(fd, mappingAddress(offset), mappingLength(offset))

For a SYNC buffer I'll redirect to call

  force(0, limit())

That will retain the existing behaviour for force() on non-SYNC buffers
and ensure the call to Objects.checkFromIndexSize in force(int, int)
does not throw any surprise IOOBEs.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the core-libs-dev mailing list