RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v27]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Nov 16 16:44:31 UTC 2022


On Wed, 16 Nov 2022 16:38:10 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> In our experience with using the API, having exceptions when something is funny about close is very valuable info (as also stated in the javadoc). Almost always there's a subtle temporal bug going on which the ISE catches. I'm not sure if here you refer to the fact that the javadoc is being overly broad in saying "already been closed" instead of "already been closed _successfully_" ? What kind of problems are you thinking of?
>
> Most of the AutoCloseable in the platform are Closeables where close is specified to have no effect when already closed. With a confined Arena it would be benign for the owner to invoke close again. If it's been useful at finding bugs then okay. The scenario that made me wonder about this is something like the follow where MyWrapper::close invokes Arena::close.
> 
>         try (var arena = Arena.openConfined();
>              var wrapper = new MyWrapper(arena)) {
>             :
>         }

Actually, I see that the `@apiNote` we used to have has disappeared in the API reshuffling. I will add it back.

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

PR: https://git.openjdk.org/jdk/pull/10872


More information about the hotspot-dev mailing list