RFR: 8287809: Revisit implementation of memory session [v4]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jun 17 21:50:05 UTC 2022


On Fri, 17 Jun 2022 20:39:40 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revert implicit vs. heap session changes
>
> src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java line 530:
> 
>> 528:             bufferSession = bufferSegment.session;
>> 529:         } else {
>> 530:             bufferSession = MemorySessionImpl.heapSession(bb);
> 
> I think this should be tweaked (as part of another patch). Buffer segments should have same lifecycle of array segments - and array segments have the global session. This is because an array segment always keeps the underlying array alive. I think we should enhance memory segment implementation (esp. that of native segments), so that it can be used to keep other objects alive. This would be useful also in the `loaderLookup` where we create another of those odd sessions - in that case we should just say that the segments returned by loader lookup have global scope, and keep the loader alive.

I've filed a dependent PR for this: https://urldefense.com/v3/__https://github.com/openjdk/jdk19/pull/39__;!!ACWV5N9M2RV99hQ!LNsRgoqWnca5DjZEbihMqD3ymdjqIteLQUbxZka3ZxNFe_KWilsdy2oH81S_xl7V07y10vgZa8C8cHCJF8m0xmdEFD8C$ 

-------------

PR: https://git.openjdk.org/jdk19/pull/22



More information about the security-dev mailing list