Hello Peter,
the changes look good, however there might be more to consider:
- `jdk.internal.access.SharedSecrets.getJavaLangRefAccess()`
Might be good to add a comment there or for `java.lang.ref.Reference` that it
is (hopefully?)
initialized during JVM start-up. Similar to the comment for
Implement three optimiztations for Reader.read(CharBuffer)
* Add a code path for heap buffers in Reader#read to use the backing array
instead of allocating a new one.
* Change the code path for direct buffers in Reader#read to limit the
intermediate allocation to `TRANSFER_BUFFER_SIZE`.
*
On Thu, 31 Dec 2020 10:10:56 GMT, Philippe Marschall
wrote:
> Implement three optimiztations for Reader.read(CharBuffer)
>
> * Add a code path for heap buffers in Reader#read to use the backing array
> instead of allocating a new one.
> * Change the code path for direct buffers in Reader#read
On 12/31/20 2:30 AM, Hans Boehm wrote:
It sounds as though this would be correct if
if (static_field == null) {
initialize();
}
return static_field;
```
were rewritten as
Foo my_local_copy = static_field;
if (my_copy == null) {
initialize();
my_local_copy = static_field;
}
return
See: https://bugs.openjdk.java.net/browse/JDK-8259021
See also discussion in thread:
https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-December/072798.html
-
Commit messages:
- 8259021 avoid double racy reads from non-volatile fields of SharedSecrets
Changes: