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!MJBIdOCiCKapELuC4Frw5pEuyVqRHww-MJCCcp8fMDAaZcb6YI6rfye8wDUuXhq1hH1KW5uKFYelFb2-TUmhiC3KLuku$ 
> 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 security-dev mailing list