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

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jun 17 18:25:25 UTC 2022


On Fri, 17 Jun 2022 18:19:22 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This is a JDK 19 clone of: https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/9017__;!!ACWV5N9M2RV99hQ!P7sU9UDKU8tT1iAO9LVvEHY405JOZwI2z8rLL3-ARQTa7ikW-1bYQJvtSC2KTMkZZ2-OCKKdpbjG5qunW-7bt6qpT3197Q$ 
>
> Maurizio Cimadamore has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
> 
>  - Merge branch 'master' into memory_session_cleanup
>  - Fix issue in Direct-X-Buffer template
>  - Simplify and drop the state class
>  - Add missing files
>  - Initial push

I ended up simplifying this PR, by selecting some of the improvement from the previous patch:
* simplify handling of "readOnly" for memory segments
* Remove duplication between `sessionImpl` and `session` accessors, by making non-closeable views also be subclasses of `MemorySessionImpl`
* use better naming for the `checkValidState` methods - now the plain method is the method that should be used by all clients, while `checkValidStateRaw` is the method that should only be used in ScopedMemoryAccess
* unify exception handling, and fix issues around WrongThreadException not being handled correctly in ScopedMemoryAccess

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

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


More information about the core-libs-dev mailing list