public class UnsafeAccess extends Object
AtomicReferenceFieldUpdater
and similar but their performance is arguably worse than the DIY approach
(depending on JVM version) while Unsafe intrinsification is a far lesser challenge for JIT compilers.
AtomicReferenceArray
.
Modifier and Type | Field and Description |
---|---|
static boolean |
SUPPORTS_GET_AND_SET |
static sun.misc.Unsafe |
UNSAFE |
Constructor and Description |
---|
UnsafeAccess() |
public static final boolean SUPPORTS_GET_AND_SET
public static final sun.misc.Unsafe UNSAFE
public static long fieldOffset(Class clz, String fieldName) throws RuntimeException
RuntimeException
Copyright © 2013–2018. All rights reserved.