On Sat, 27 May 2023 14:21:28 GMT, Alan Bateman <al...@openjdk.org> wrote:
> This looks okay. Have you checked the other usages of > ReleasePrimitiveArrayCritical (e.g. libzip) see if they need the copy back > when releasing? I can immediately see code in `Java_java_util_zip_Inflater_inflateBytesBytes` that needs the same fix in relation to the input array. Even if there is no issue with read-only memory when writing back an unchanged array, we should avoid unnecessary copying. That said I'm not sure it is up to this issue/PR to take responsibility for policing all uses of `ReleasePrimitiveArrayCritical` in the JDK libraries. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14117#issuecomment-1566418737