RFR: 8324972: (bf) Make DirectByteBuffer.Deallocator idempotent [v3]
Per Minborg
pminborg at openjdk.org
Thu Feb 8 09:32:57 UTC 2024
On Wed, 31 Jan 2024 17:49:56 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Swith to using Unsafe
>
> src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template line 82:
>
>> 80: private static final class Deallocator implements Runnable {
>> 81:
>> 82: private static final long INVOKED_OFFSET = Unsafe.getUnsafe()
>
> There are two invocations of Unsafe.getUnsafe introduced here, while the base class Buffer has initialised the static UNSAFE (i.e. the reference used for freeMemory.) Could this static be used to replace Unsafe.getUnsafe ?
Good catch!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17647#discussion_r1482665699
More information about the nio-dev
mailing list