public final class StandardMemoryAccessor extends Object
MemoryAccessor
implementations
that directly uses Unsafe
for accessing to memory.Modifier and Type | Field and Description |
---|---|
static StandardMemoryAccessor |
INSTANCE |
MEM_COPY_THRESHOLD
ARRAY_BOOLEAN_BASE_OFFSET, ARRAY_BOOLEAN_INDEX_SCALE, ARRAY_BYTE_BASE_OFFSET, ARRAY_BYTE_INDEX_SCALE, ARRAY_CHAR_BASE_OFFSET, ARRAY_CHAR_INDEX_SCALE, ARRAY_DOUBLE_BASE_OFFSET, ARRAY_DOUBLE_INDEX_SCALE, ARRAY_FLOAT_BASE_OFFSET, ARRAY_FLOAT_INDEX_SCALE, ARRAY_INT_BASE_OFFSET, ARRAY_INT_INDEX_SCALE, ARRAY_LONG_BASE_OFFSET, ARRAY_LONG_INDEX_SCALE, ARRAY_OBJECT_BASE_OFFSET, ARRAY_OBJECT_INDEX_SCALE, ARRAY_SHORT_BASE_OFFSET, ARRAY_SHORT_INDEX_SCALE
Modifier and Type | Method and Description |
---|---|
int |
arrayBaseOffset(Class<?> arrayClass)
Gets the base offset of the array typed with given class.
|
int |
arrayIndexScale(Class<?> arrayClass)
Gets the index scale of the array typed with given class.
|
boolean |
compareAndSwapInt(long address,
int expected,
int x)
Compares and swaps the given int value to the expected value atomically
based in the given object with given offset
if and only if its current value equals to specified expected value.
|
boolean |
compareAndSwapInt(Object base,
long offset,
int expected,
int x)
Compares and swaps an int value to an expected value atomically
based by given object with given offset,
if and only if its current value is equal to the expected value.
|
boolean |
compareAndSwapLong(long address,
long expected,
long x)
Compares and swaps the long value to the expected value atomically
based in the given object with given offset
if and only if its current value equals the expected value.
|
boolean |
compareAndSwapLong(Object base,
long offset,
long expected,
long x)
Compares and swaps a long value to an expected value atomically
based by given object with given offset
if and only if its current value equals to the expected value.
|
boolean |
compareAndSwapObject(long address,
Object expected,
Object x)
Compares and swaps the referenced object to the expected object atomically
based by given owner object at given offset
if and only if its current referenced object is the expected object.
|
boolean |
compareAndSwapObject(Object base,
long offset,
Object expected,
Object x)
Compares and swaps referenced object to expected object atomically
based by given owner object at given offset
if and only if its current object is the expected object.
|
void |
copyFromByteArray(byte[] source,
int offset,
long destAddress,
int length)
Copies bytes from a Java byte array into this accessor's address space.
|
void |
copyMemory(long srcAddress,
long destAddress,
long lengthBytes)
Copies memory from given source address to given destination address
as given size.
|
void |
copyMemory(Object srcObj,
long srcOffset,
Object destObj,
long destOffset,
long lengthBytes)
Copies memory from source to destination.
|
void |
copyToByteArray(long srcAddress,
byte[] destination,
int offset,
int length)
Copies bytes from this accessor's address space to a Java byte array.
|
boolean |
getBoolean(long address)
Reads the boolean value from given address.
|
boolean |
getBoolean(Object base,
long offset)
Returns the boolean value at the supplied offset from the supplied object's base address.
|
boolean |
getBooleanVolatile(long address)
Reads the boolean value as volatile from given object by its offset.
|
boolean |
getBooleanVolatile(Object base,
long offset)
Reads the boolean value as volatile from given object by its offset.
|
byte |
getByte(long address)
Reads the byte value from given address.
|
byte |
getByte(Object base,
long offset)
Return byte from external resource
|
byte |
getByteVolatile(long address)
Reads the byte value as volatile from given object by its offset.
|
byte |
getByteVolatile(Object base,
long offset)
Reads the byte value as volatile from given object by its offset.
|
char |
getChar(long address)
Reads the char value from given address.
|
char |
getChar(Object base,
long offset)
Returns the char value at the supplied offset from the supplied object's base address.
|
char |
getCharVolatile(long address)
Reads the char value as volatile from given object by its offset.
|
char |
getCharVolatile(Object base,
long offset)
Reads the char value as volatile from given object by its offset.
|
double |
getDouble(long address)
Reads the double value from given address.
|
double |
getDouble(Object base,
long offset)
Returns the double value at the supplied offset from the supplied object's base address.
|
double |
getDoubleVolatile(long address)
Reads the double value as volatile from given object by its offset.
|
double |
getDoubleVolatile(Object base,
long offset)
Reads the double value as volatile from given object by its offset.
|
float |
getFloat(long address)
Reads the float value from given address.
|
float |
getFloat(Object base,
long offset)
Returns the float value at the supplied offset from the supplied object's base address.
|
float |
getFloatVolatile(long address)
Reads the float value as volatile from given object by its offset.
|
float |
getFloatVolatile(Object base,
long offset)
Reads the float value as volatile from given object by its offset.
|
int |
getInt(long address)
Reads the int value from given address.
|
int |
getInt(Object base,
long offset)
Returns the int value at the supplied offset from the supplied object's base address.
|
int |
getIntVolatile(long address)
Reads the int value as volatile from given object by its offset.
|
int |
getIntVolatile(Object base,
long offset)
Reads the int value as volatile from given object by its offset.
|
long |
getLong(long address)
Reads the long value from given address.
|
long |
getLong(Object base,
long offset)
Returns the long value at the supplied offset from the supplied object's base address.
|
long |
getLongVolatile(long address)
Reads the long value as volatile from given object by its offset.
|
long |
getLongVolatile(Object base,
long offset)
Reads the long value as volatile from given object by its offset.
|
Object |
getObject(Object base,
long offset)
Returns the object reference at the supplied offset from the supplied object's base address.
|
Object |
getObjectVolatile(Object base,
long offset)
Gets the referenced object from given owner object as volatile by its offset.
|
short |
getShort(long address)
Reads the short value from given address.
|
short |
getShort(Object base,
long offset)
Returns the short value at the supplied offset from the supplied object's base address.
|
short |
getShortVolatile(long address)
Reads the short value as volatile from given object by its offset.
|
short |
getShortVolatile(Object base,
long offset)
Reads the short value as volatile from given object by its offset.
|
static boolean |
isAvailable()
Returns whether memory accessors of type
UnsafeBasedMemoryAccessor are available or not. |
boolean |
isBigEndian()
Tells whether this memory accessor is big- or little-endian.
|
long |
objectFieldOffset(Field field)
Gets the offset of given field.
|
void |
putBoolean(long address,
boolean x)
Writes the given boolean value to given address.
|
void |
putBoolean(Object base,
long offset,
boolean x)
Puts the supplied boolean value at the supplied offset from the supplied object's base address.
|
void |
putBooleanVolatile(long address,
boolean x)
Writes the boolean value as volatile to given object by its offset.
|
void |
putBooleanVolatile(Object base,
long offset,
boolean x)
Writes the boolean value as volatile to given object by its offset.
|
void |
putByte(long address,
byte x)
Writes the given byte value to given address.
|
void |
putByte(Object base,
long offset,
byte x)
Writes byte to corresponding resource
|
void |
putByteVolatile(long address,
byte x)
Writes the byte value as volatile to given object by its offset.
|
void |
putByteVolatile(Object base,
long offset,
byte x)
Writes the byte value as volatile to given object by its offset.
|
void |
putChar(long address,
char x)
Writes the given char value to given address.
|
void |
putChar(Object base,
long offset,
char x)
Puts the supplied char value at the supplied offset from the supplied object's base address.
|
void |
putCharVolatile(long address,
char x)
Writes the char value as volatile to given object by its offset.
|
void |
putCharVolatile(Object base,
long offset,
char x)
Writes the char value as volatile to given object by its offset.
|
void |
putDouble(long address,
double x)
Writes the given double value to given address.
|
void |
putDouble(Object base,
long offset,
double x)
Puts the supplied double value at the supplied offset from the supplied object's base address.
|
void |
putDoubleVolatile(long address,
double x)
Writes the double value as volatile to given object by its offset.
|
void |
putDoubleVolatile(Object base,
long offset,
double x)
Writes the double value as volatile to given object by its offset.
|
void |
putFloat(long address,
float x)
Writes the given float value to given address.
|
void |
putFloat(Object base,
long offset,
float x)
Puts the supplied float value at the supplied offset from the supplied object's base address.
|
void |
putFloatVolatile(long address,
float x)
Writes the float value as volatile to given object by its offset.
|
void |
putFloatVolatile(Object base,
long offset,
float x)
Writes the float value as volatile to given object by its offset.
|
void |
putInt(long address,
int x)
Writes the given int value to given address.
|
void |
putInt(Object base,
long offset,
int x)
Puts the supplied int value at the supplied offset from the supplied object's base address.
|
void |
putIntVolatile(long address,
int x)
Writes the int value as volatile to given object by its offset.
|
void |
putIntVolatile(Object base,
long offset,
int x)
Writes the int value as volatile to given object by its offset.
|
void |
putLong(long address,
long x)
Writes the given long value to given address.
|
void |
putLong(Object base,
long offset,
long x)
Puts the supplied long value at the supplied offset from the supplied object's base address.
|
void |
putLongVolatile(long address,
long x)
Writes the long value as volatile to given object by its offset.
|
void |
putLongVolatile(Object base,
long offset,
long x)
Writes the long value as volatile to given object by its offset.
|
void |
putObject(Object base,
long offset,
Object x)
Puts the supplied object reference at the supplied offset from the supplied object's base address.
|
void |
putObjectVolatile(Object base,
long offset,
Object x)
Puts the referenced object to given owner object as volatile by its offset.
|
void |
putOrderedInt(long address,
int x)
Puts the given int value as ordered to the CPU write buffer
based in the given object at the given offset.
|
void |
putOrderedInt(Object base,
long offset,
int x)
Puts the given int value as ordered to the CPU write buffer
based by the given object at the given offset.
|
void |
putOrderedLong(long address,
long x)
Puts the given long value as ordered to the CPU write buffer
based in the given object at the given offset.
|
void |
putOrderedLong(Object base,
long offset,
long x)
Puts the given long value as ordered to the CPU write buffer
based by the given object at the given offset.
|
void |
putOrderedObject(long address,
Object x)
Puts the given referenced object as ordered to the CPU write buffer
based by the given owner object at the given offset.
|
void |
putOrderedObject(Object base,
long offset,
Object x)
Puts the given referenced object as ordered to the CPU write buffer
based by the given owner object at the given offset.
|
void |
putShort(long address,
short x)
Writes the given short value to given address.
|
void |
putShort(Object base,
long offset,
short x)
Puts the supplied short value at the supplied offset from the supplied object's base address.
|
void |
putShortVolatile(long address,
short x)
Writes the short value as volatile to given object by its offset.
|
void |
putShortVolatile(Object base,
long offset,
short x)
Writes the short value as volatile to given object by its offset.
|
void |
setMemory(long address,
long lengthBytes,
byte value)
Sets memory with given value from specified address as given size.
|
public static final StandardMemoryAccessor INSTANCE
public boolean isBigEndian()
MemoryAccessor
get/putChar
, get/putShort
,
get/putInt
, get/putLong
declared in this interface and others declared
in subinterfaces).isBigEndian
in interface MemoryAccessor
true
if the accessor is big-endian; false
otherwisepublic boolean getBoolean(long address)
MemoryAccessor
address
- the address where the boolean value will be read frompublic void putBoolean(long address, boolean x)
MemoryAccessor
address
- the address where the boolean value will be written tox
- the boolean value to be writtenpublic byte getByte(long address)
MemoryAccessor
address
- the address where the byte value will be read frompublic void putByte(long address, byte x)
MemoryAccessor
address
- the address where the byte value will be written tox
- the byte value to be writtenpublic char getChar(long address)
MemoryAccessor
address
- the address where the char value will be read frompublic void putChar(long address, char x)
MemoryAccessor
address
- the address where the char value will be written tox
- the char value to be writtenpublic short getShort(long address)
MemoryAccessor
address
- the address where the short value will be read frompublic void putShort(long address, short x)
MemoryAccessor
address
- the address where the short value will be written tox
- the short value to be writtenpublic int getInt(long address)
MemoryAccessor
address
- the address where the int value will be read frompublic void putInt(long address, int x)
MemoryAccessor
address
- the address where the int value will be written tox
- the int value to be writtenpublic float getFloat(long address)
MemoryAccessor
address
- the address where the float value will be read frompublic void putFloat(long address, float x)
MemoryAccessor
address
- the address where the float value will be written tox
- the float value to be writtenpublic long getLong(long address)
MemoryAccessor
address
- the address where the long value will be read frompublic void putLong(long address, long x)
MemoryAccessor
address
- the address where the long value will be written tox
- the long value to be writtenpublic double getDouble(long address)
MemoryAccessor
address
- the address where the double value will be read frompublic void putDouble(long address, double x)
MemoryAccessor
address
- the address where the double value will be written tox
- the double value to be writtenpublic void copyMemory(long srcAddress, long destAddress, long lengthBytes)
MemoryAccessor
srcAddress
- the source address to be copied fromdestAddress
- the destination address to be copied tolengthBytes
- the number of bytes to be copiedpublic void copyFromByteArray(byte[] source, int offset, long destAddress, int length)
MemoryAccessor
source
- the source byte arrayoffset
- index of the first byte to copydestAddress
- address where the first byte will be writtenlength
- number of bytes to copypublic void copyToByteArray(long srcAddress, byte[] destination, int offset, int length)
MemoryAccessor
srcAddress
- address of the first byte to copydestination
- the destination byte arrayoffset
- array index where the first byte will be writtenlength
- number of bytes to copypublic void setMemory(long address, long lengthBytes, byte value)
MemoryAccessor
address
- the start address of the memory region
which will be set with the given valuelengthBytes
- the number of bytes to be setvalue
- the value to be setpublic boolean getBooleanVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putBooleanVolatile(long address, boolean x)
ConcurrentMemoryAccessor
address
- address to accessx
- the boolean value to be writtenpublic byte getByteVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putByteVolatile(long address, byte x)
ConcurrentMemoryAccessor
address
- address to accessx
- the byte value to be writtenpublic char getCharVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putCharVolatile(long address, char x)
ConcurrentMemoryAccessor
address
- address to accessx
- the char value to be writtenpublic short getShortVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putShortVolatile(long address, short x)
ConcurrentMemoryAccessor
address
- address to accessx
- the short value to be writtenpublic int getIntVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putIntVolatile(long address, int x)
ConcurrentMemoryAccessor
address
- address to accessx
- the int value to be writtenpublic float getFloatVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putFloatVolatile(long address, float x)
ConcurrentMemoryAccessor
address
- address to accessx
- the float value to be writtenpublic long getLongVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putLongVolatile(long address, long x)
ConcurrentMemoryAccessor
address
- address to accessx
- the long value to be writtenpublic double getDoubleVolatile(long address)
ConcurrentMemoryAccessor
address
- address to accesspublic void putDoubleVolatile(long address, double x)
ConcurrentMemoryAccessor
address
- address to accessx
- the double value to be writtenpublic boolean compareAndSwapInt(long address, int expected, int x)
ConcurrentMemoryAccessor
address
- address to accessexpected
- the expected current int value to be set to the new int valuex
- the int value to be writtenpublic boolean compareAndSwapLong(long address, long expected, long x)
ConcurrentMemoryAccessor
address
- address to accessexpected
- the expected current long value to be set to the new long valuex
- the long value to be writtenpublic boolean compareAndSwapObject(long address, Object expected, Object x)
ConcurrentMemoryAccessor
address
- address to accessexpected
- the expected current object to be set to the new referenced objectx
- the referenced object to be writtenpublic void putOrderedInt(long address, int x)
ConcurrentMemoryAccessor
address
- address to accessx
- the int value to be writtenpublic void putOrderedLong(long address, long x)
ConcurrentMemoryAccessor
address
- address to accessx
- the long value to be writtenpublic void putOrderedObject(long address, Object x)
ConcurrentMemoryAccessor
address
- address to accessx
- the referenced object to be writtenpublic long objectFieldOffset(Field field)
HeapMemoryAccessor
field
- the field whose offset is requestedpublic int arrayBaseOffset(Class<?> arrayClass)
HeapMemoryAccessor
arrayClass
- the type of the array whose base offset is requestedpublic int arrayIndexScale(Class<?> arrayClass)
HeapMemoryAccessor
arrayClass
- the type of the array whose index scale is requestedpublic Object getObject(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putObject(Object base, long offset, Object x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic boolean getBoolean(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putBoolean(Object base, long offset, boolean x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic byte getByte(Object base, long offset)
ByteAccessStrategy
base
- - resource to accessoffset
- - offset of bytepublic void putByte(Object base, long offset, byte x)
ByteAccessStrategy
base
- - resource to accessoffset
- - offset of bytex
- - byte to writepublic char getChar(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putChar(Object base, long offset, char x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic short getShort(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putShort(Object base, long offset, short x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic int getInt(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putInt(Object base, long offset, int x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic float getFloat(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putFloat(Object base, long offset, float x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic long getLong(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putLong(Object base, long offset, long x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic double getDouble(Object base, long offset)
HeapMemoryAccessor
base
- the object whose base address to use for the operationoffset
- offset from object's base to the accessed locationpublic void putDouble(Object base, long offset, double x)
HeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic void copyMemory(Object srcObj, long srcOffset, Object destObj, long destOffset, long lengthBytes)
HeapMemoryAccessor
(baseObject, offset)
such that the offset is added to the object's base
address on Java heap.srcObj
- source objectsrcOffset
- source offsetdestObj
- destination objectdestOffset
- destination offsetlengthBytes
- number of bytes to be copiedpublic Object getObjectVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the owner object where the referenced object will be read fromoffset
- offset from object's base to the accessed locationpublic void putObjectVolatile(Object base, long offset, Object x)
ConcurrentHeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic boolean getBooleanVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where boolean value will be read fromoffset
- offset from object's base to the accessed locationpublic void putBooleanVolatile(Object base, long offset, boolean x)
ConcurrentHeapMemoryAccessor
base
- the object where boolean value will be written tooffset
- offset from object's base to the accessed locationx
- the boolean value to be writtenpublic byte getByteVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where the byte value will be read fromoffset
- offset from object's base to the accessed locationpublic void putByteVolatile(Object base, long offset, byte x)
ConcurrentHeapMemoryAccessor
base
- the object where the byte value will be written tooffset
- offset from object's base to the accessed locationx
- the byte value to be writtenpublic char getCharVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where char value will be read fromoffset
- offset from object's base to the accessed locationpublic void putCharVolatile(Object base, long offset, char x)
ConcurrentHeapMemoryAccessor
base
- the object where char value will be written tooffset
- offset from object's base to the accessed locationx
- the char value to be writtenpublic short getShortVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where short value will be read fromoffset
- offset from object's base to the accessed locationpublic void putShortVolatile(Object base, long offset, short x)
ConcurrentHeapMemoryAccessor
base
- the object where short value will be written tooffset
- offset from object's base to the accessed locationx
- the short value to be writtenpublic int getIntVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where int value will be read fromoffset
- offset from object's base to the accessed locationpublic void putIntVolatile(Object base, long offset, int x)
ConcurrentHeapMemoryAccessor
base
- the object where int value will be written tooffset
- offset from object's base to the accessed locationx
- the int value to be writtenpublic float getFloatVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where float value will be read fromoffset
- offset from object's base to the accessed locationpublic void putFloatVolatile(Object base, long offset, float x)
ConcurrentHeapMemoryAccessor
base
- the object where float value will be written tooffset
- offset from object's base to the accessed locationx
- the float value to be writtenpublic long getLongVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where long value will be read fromoffset
- offset from object's base to the accessed locationpublic void putLongVolatile(Object base, long offset, long x)
ConcurrentHeapMemoryAccessor
base
- the object where long value will be written tooffset
- offset from object's base to the accessed locationx
- the long value to be writtenpublic double getDoubleVolatile(Object base, long offset)
ConcurrentHeapMemoryAccessor
base
- the object where double value will be read fromoffset
- offset from object's base to the accessed locationpublic void putDoubleVolatile(Object base, long offset, double x)
ConcurrentHeapMemoryAccessor
base
- the object where double value will be written tooffset
- offset from object's base to the accessed locationx
- the double value to be writtenpublic void putOrderedInt(Object base, long offset, int x)
ConcurrentHeapMemoryAccessor
base
- the object where the int value will be written tooffset
- offset from object's base to the accessed locationx
- the int value to be writtenpublic void putOrderedLong(Object base, long offset, long x)
ConcurrentHeapMemoryAccessor
base
- the object where the long value will be written tooffset
- offset from object's base to the accessed locationx
- the long value to be writtenpublic void putOrderedObject(Object base, long offset, Object x)
ConcurrentHeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationx
- the referenced object to be writtenpublic boolean compareAndSwapInt(Object base, long offset, int expected, int x)
ConcurrentHeapMemoryAccessor
base
- the object where int value will be written tooffset
- offset from object's base to the accessed locationexpected
- the expected current int value to be set new int valuex
- the int value to be writtenpublic boolean compareAndSwapLong(Object base, long offset, long expected, long x)
ConcurrentHeapMemoryAccessor
base
- the object where long value will be written tooffset
- offset from object's base to the accessed locationexpected
- the expected current long value to be set new long valuex
- the long value to be writtenpublic boolean compareAndSwapObject(Object base, long offset, Object expected, Object x)
ConcurrentHeapMemoryAccessor
base
- the owner object where the referenced object will be written tooffset
- offset from object's base to the accessed locationexpected
- the expected current referenced object to be set to new referenced objectx
- the new referenced object that will be writtenpublic static boolean isAvailable()
UnsafeBasedMemoryAccessor
are available or not.Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.