public final class Unsafe


Summary

Constants

static final int

Public methods

native int
native Object
native long
allocateMemory(long bytes)
int
int
native boolean
compareAndSwapInt(
    Object obj,
    long offset,
    int expectedValue,
    int newValue
)
native boolean
compareAndSwapLong(
    Object obj,
    long offset,
    long expectedValue,
    long newValue
)
native boolean
compareAndSwapObject(
    Object obj,
    long offset,
    Object expectedValue,
    Object newValue
)
native void
copyMemory(long srcAddr, long dstAddr, long bytes)
native void
copyMemoryFromPrimitiveArray(
    Object src,
    long srcOffset,
    long dstAddr,
    long bytes
)
native void
copyMemoryToPrimitiveArray(
    long srcAddr,
    Object dst,
    long dstOffset,
    long bytes
)
native void
freeMemory(long address)
native void
int
getAndAddInt(Object o, long offset, int delta)
long
getAndAddLong(Object o, long offset, long delta)
int
getAndSetInt(Object o, long offset, int newValue)
long
getAndSetLong(Object o, long offset, long newValue)
Object
getAndSetObject(Object o, long offset, Object newValue)
native boolean
getBoolean(Object obj, long offset)
native byte
getByte(long address)
native byte
getByte(Object obj, long offset)
native char
getChar(long address)
native char
getChar(Object obj, long offset)
native double
getDouble(long address)
native double
getDouble(Object obj, long offset)
native float
getFloat(long address)
native float
getFloat(Object obj, long offset)
native int
getInt(long address)
native int
getInt(Object obj, long offset)
native int
getIntVolatile(Object obj, long offset)
native long
getLong(long address)
native long
getLong(Object obj, long offset)
native long
getLongVolatile(Object obj, long offset)
native Object
getObject(Object obj, long offset)
native Object
getObjectVolatile(Object obj, long offset)
native short
getShort(long address)
native short
getShort(Object obj, long offset)
static Unsafe
native void
long
native int
void
park(boolean absolute, long time)
native void
putBoolean(Object obj, long offset, boolean newValue)
native void
putByte(long address, byte x)
native void
putByte(Object obj, long offset, byte newValue)
native void
putChar(long address, char x)
native void
putChar(Object obj, long offset, char newValue)
native void
putDouble(long address, double x)
native void
putDouble(Object obj, long offset, double newValue)
native void
putFloat(long address, float x)
native void
putFloat(Object obj, long offset, float newValue)
native void
putInt(long address, int x)
native void
putInt(Object obj, long offset, int newValue)
native void
putIntVolatile(Object obj, long offset, int newValue)
native void
putLong(long address, long x)
native void
putLong(Object obj, long offset, long newValue)
native void
putLongVolatile(Object obj, long offset, long newValue)
native void
putObject(Object obj, long offset, Object newValue)
native void
putObjectVolatile(Object obj, long offset, Object newValue)
native void
putOrderedInt(Object obj, long offset, int newValue)
native void
putOrderedLong(Object obj, long offset, long newValue)
native void
putOrderedObject(Object obj, long offset, Object newValue)
native void
putShort(long address, short x)
native void
putShort(Object obj, long offset, short newValue)
native void
setMemory(long address, long bytes, byte value)
native void
void

Constants

INVALID_FIELD_OFFSET

Added in 1.0.0-alpha01
public static final int INVALID_FIELD_OFFSET = -1

Public methods

addressSize

Added in 1.0.0-alpha01
native public int addressSize()

allocateInstance

Added in 1.0.0-alpha01
native public Object allocateInstance(Class<Object> c)

allocateMemory

Added in 1.0.0-alpha01
native public long allocateMemory(long bytes)

arrayBaseOffset

Added in 1.0.0-alpha01
public int arrayBaseOffset(Class<Object> clazz)

arrayIndexScale

Added in 1.0.0-alpha01
public int arrayIndexScale(Class<Object> clazz)

compareAndSwapInt

Added in 1.0.0-alpha01
native public boolean compareAndSwapInt(
    Object obj,
    long offset,
    int expectedValue,
    int newValue
)

compareAndSwapLong

Added in 1.0.0-alpha01
native public boolean compareAndSwapLong(
    Object obj,
    long offset,
    long expectedValue,
    long newValue
)

compareAndSwapObject

Added in 1.0.0-alpha01
native public boolean compareAndSwapObject(
    Object obj,
    long offset,
    Object expectedValue,
    Object newValue
)

copyMemory

Added in 1.0.0-alpha01
native public void copyMemory(long srcAddr, long dstAddr, long bytes)

copyMemoryFromPrimitiveArray

Added in 1.0.0-alpha01
native public void copyMemoryFromPrimitiveArray(
    Object src,
    long srcOffset,
    long dstAddr,
    long bytes
)

copyMemoryToPrimitiveArray

Added in 1.0.0-alpha01
native public void copyMemoryToPrimitiveArray(
    long srcAddr,
    Object dst,
    long dstOffset,
    long bytes
)

freeMemory

Added in 1.0.0-alpha01
native public void freeMemory(long address)

fullFence

Added in 1.0.0-alpha01
native public void fullFence()

getAndAddInt

Added in 1.0.0-alpha01
public int getAndAddInt(Object o, long offset, int delta)

getAndAddLong

Added in 1.0.0-alpha01
public long getAndAddLong(Object o, long offset, long delta)

getAndSetInt

Added in 1.0.0-alpha01
public int getAndSetInt(Object o, long offset, int newValue)

getAndSetLong

Added in 1.0.0-alpha01
public long getAndSetLong(Object o, long offset, long newValue)

getAndSetObject

Added in 1.0.0-alpha01
public Object getAndSetObject(Object o, long offset, Object newValue)

getBoolean

Added in 1.0.0-alpha01
native public boolean getBoolean(Object obj, long offset)

getByte

Added in 1.0.0-alpha01
native public byte getByte(long address)

getByte

Added in 1.0.0-alpha01
native public byte getByte(Object obj, long offset)

getChar

Added in 1.0.0-alpha01
native public char getChar(long address)

getChar

Added in 1.0.0-alpha01
native public char getChar(Object obj, long offset)

getDouble

Added in 1.0.0-alpha01
native public double getDouble(long address)

getDouble

Added in 1.0.0-alpha01
native public double getDouble(Object obj, long offset)

getFloat

Added in 1.0.0-alpha01
native public float getFloat(long address)

getFloat

Added in 1.0.0-alpha01
native public float getFloat(Object obj, long offset)

getInt

Added in 1.0.0-alpha01
native public int getInt(long address)

getInt

Added in 1.0.0-alpha01
native public int getInt(Object obj, long offset)

getIntVolatile

Added in 1.0.0-alpha01
native public int getIntVolatile(Object obj, long offset)

getLong

Added in 1.0.0-alpha01
native public long getLong(long address)

getLong

Added in 1.0.0-alpha01
native public long getLong(Object obj, long offset)

getLongVolatile

Added in 1.0.0-alpha01
native public long getLongVolatile(Object obj, long offset)

getObject

Added in 1.0.0-alpha01
native public Object getObject(Object obj, long offset)

getObjectVolatile

Added in 1.0.0-alpha01
native public Object getObjectVolatile(Object obj, long offset)

getShort

Added in 1.0.0-alpha01
native public short getShort(long address)

getShort

Added in 1.0.0-alpha01
native public short getShort(Object obj, long offset)

getUnsafe

Added in 1.0.0-alpha01
public static Unsafe getUnsafe()

loadFence

Added in 1.0.0-alpha01
native public void loadFence()

objectFieldOffset

Added in 1.0.0-alpha01
public long objectFieldOffset(Field field)

pageSize

Added in 1.0.0-alpha01
native public int pageSize()

park

Added in 1.0.0-alpha01
public void park(boolean absolute, long time)

putBoolean

Added in 1.0.0-alpha01
native public void putBoolean(Object obj, long offset, boolean newValue)

putByte

Added in 1.0.0-alpha01
native public void putByte(long address, byte x)

putByte

Added in 1.0.0-alpha01
native public void putByte(Object obj, long offset, byte newValue)

putChar

Added in 1.0.0-alpha01
native public void putChar(long address, char x)

putChar

Added in 1.0.0-alpha01
native public void putChar(Object obj, long offset, char newValue)

putDouble

Added in 1.0.0-alpha01
native public void putDouble(long address, double x)

putDouble

Added in 1.0.0-alpha01
native public void putDouble(Object obj, long offset, double newValue)

putFloat

Added in 1.0.0-alpha01
native public void putFloat(long address, float x)

putFloat

Added in 1.0.0-alpha01
native public void putFloat(Object obj, long offset, float newValue)

putInt

Added in 1.0.0-alpha01
native public void putInt(long address, int x)

putInt

Added in 1.0.0-alpha01
native public void putInt(Object obj, long offset, int newValue)

putIntVolatile

Added in 1.0.0-alpha01
native public void putIntVolatile(Object obj, long offset, int newValue)

putLong

Added in 1.0.0-alpha01
native public void putLong(long address, long x)

putLong

Added in 1.0.0-alpha01
native public void putLong(Object obj, long offset, long newValue)

putLongVolatile

Added in 1.0.0-alpha01
native public void putLongVolatile(Object obj, long offset, long newValue)

putObject

Added in 1.0.0-alpha01
native public void putObject(Object obj, long offset, Object newValue)

putObjectVolatile

Added in 1.0.0-alpha01
native public void putObjectVolatile(Object obj, long offset, Object newValue)

putOrderedInt

Added in 1.0.0-alpha01
native public void putOrderedInt(Object obj, long offset, int newValue)

putOrderedLong

Added in 1.0.0-alpha01
native public void putOrderedLong(Object obj, long offset, long newValue)

putOrderedObject

Added in 1.0.0-alpha01
native public void putOrderedObject(Object obj, long offset, Object newValue)

putShort

Added in 1.0.0-alpha01
native public void putShort(long address, short x)

putShort

Added in 1.0.0-alpha01
native public void putShort(Object obj, long offset, short newValue)

setMemory

Added in 1.0.0-alpha01
native public void setMemory(long address, long bytes, byte value)

storeFence

Added in 1.0.0-alpha01
native public void storeFence()

unpark

Added in 1.0.0-alpha01
public void unpark(Object obj)