Hi Chris/Alan,

On 17/02/2019 17:37, Alan Bateman wrote:
> On 15/02/2019 17:13, Chris Hegarty wrote:
>> :
>> I see that there are changes to the Java SE Platform, namely to the
>> MapMode constructor and an overload of MappedByteBuffer::force. I see
>> these more as "enablers" in support of this feature ( rather than the
>> core of the feature itself ). They can happen as part of the same
>> changeset, or could possibly be pushed separately upfront.
>>
> Yes, the 2-arg force method is useful on its own and could be done in
> advance (if Andrew wants). There are several detailed API issues with
> this method but we should be able to agree those quickly (Andrew - these
> are issues due to MBB being a ByteBuffer so we have to sort out - long
> from/to vs. int index/size, the upper bound check against the limit
> rather the capacity, and IAE vs. IIOBE - I'll put these in another
> mail). Making map mode extensible is also something that can be done in
> advance. The only piece that is would make it SE scope is the isSync
> (was isPersistent) method but I don't think it is strictly needed to be
> exposed initially.
Ah well, perhaps we /can/ change the scope to JDK rather than SE. I
finessed the isSync() issue by dropping it from the API. Provision of
this method is not critical since I envisage that most clients which
know about the SYNC option will always be using a SYNC buffer. If not,
they can still easily be written to track how the buffer was created.
So, the latest JEP does not mention the isSync method and the
implementation makes it private.

I'd be very happy to pre-push separate, enabling changes for 1) the
2-arg force method 2) making MapMode extensible.

Alan, I'll wait for your follow-up note before responding regarding the
arguments to force. I'll just note that the latest JEP draft accepts
start position and length [i.e. force(from, length)] rather than start
position and end position [i.e. force(from, to)]. I thought this would
be easier for clients to get right -- less danger of out by one errors.

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

Reply via email to