public enum UnsafeMemory extends Enum<UnsafeMemory> implements Memory
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Field and Description |
|---|---|
static sun.misc.Unsafe |
UNSAFE |
| Modifier and Type | Method and Description |
|---|---|
int |
addInt(long address,
int increment) |
int |
addInt(Object object,
long offset,
int increment) |
long |
addLong(long address,
long increment) |
long |
addLong(Object object,
long offset,
long increment) |
long |
allocate(long capacity) |
<E> E |
allocateInstance(Class<? extends E> clazz) |
boolean |
compareAndSwapInt(long address,
int expected,
int value) |
boolean |
compareAndSwapInt(Object object,
long offset,
int expected,
int value) |
boolean |
compareAndSwapLong(long address,
long expected,
long value) |
boolean |
compareAndSwapLong(Object object,
long offset,
long expected,
long value) |
void |
copyMemory(byte[] bytes,
int offset,
long address,
int length) |
void |
copyMemory(byte[] bytes,
int offset,
Object obj2,
long offset2,
int length) |
void |
copyMemory(long fromAddress,
long address,
long length) |
void |
copyMemory(long fromAddress,
Object obj2,
long offset2,
int length) |
void |
freeMemory(long address,
long size) |
long |
getFieldOffset(Field field) |
<T> T |
getObject(Object object,
long offset) |
void |
loadFence() |
long |
nativeMemoryUsed() |
int |
pageSize() |
byte |
readByte(long address) |
byte |
readByte(Object object,
long offset) |
double |
readDouble(long address) |
double |
readDouble(Object object,
long offset) |
float |
readFloat(long address) |
float |
readFloat(Object object,
long offset) |
int |
readInt(long address) |
int |
readInt(Object object,
long offset) |
long |
readLong(long address) |
long |
readLong(Object object,
long offset) |
short |
readShort(long address) |
short |
readShort(Object object,
long offset) |
byte |
readVolatileByte(long address) |
byte |
readVolatileByte(Object object,
long offset) |
double |
readVolatileDouble(long address) |
double |
readVolatileDouble(Object object,
long offset) |
float |
readVolatileFloat(long address) |
float |
readVolatileFloat(Object object,
long offset) |
int |
readVolatileInt(long address) |
int |
readVolatileInt(Object object,
long offset) |
long |
readVolatileLong(long address) |
long |
readVolatileLong(Object object,
long offset) |
short |
readVolatileShort(long address) |
short |
readVolatileShort(Object object,
long offset) |
void |
setInt(Object object,
long offset,
int value) |
void |
setMemory(long address,
long size,
byte b) |
void |
storeFence() |
static UnsafeMemory |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static UnsafeMemory[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeByte(long address,
byte b) |
void |
writeByte(Object object,
long offset,
byte b) |
void |
writeDouble(long address,
double d) |
void |
writeDouble(Object object,
long offset,
double d) |
void |
writeFloat(long address,
float f) |
void |
writeFloat(Object object,
long offset,
float f) |
void |
writeInt(long address,
int i32) |
void |
writeInt(Object object,
long offset,
int i32) |
void |
writeLong(long address,
long i64) |
void |
writeLong(Object object,
long offset,
long i64) |
void |
writeOrderedInt(long address,
int i32) |
void |
writeOrderedInt(Object object,
long offset,
int i32) |
void |
writeOrderedLong(long address,
long i) |
void |
writeOrderedLong(Object object,
long offset,
long i) |
void |
writeShort(long address,
short i16) |
void |
writeShort(Object object,
long offset,
short i16) |
void |
writeVolatileByte(long address,
byte b) |
void |
writeVolatileByte(Object object,
long offset,
byte b) |
void |
writeVolatileDouble(long address,
double d) |
void |
writeVolatileDouble(Object object,
long offset,
double d) |
void |
writeVolatileFloat(long address,
float f) |
void |
writeVolatileFloat(Object object,
long offset,
float f) |
void |
writeVolatileInt(long address,
int i32) |
void |
writeVolatileInt(Object object,
long offset,
int i32) |
void |
writeVolatileLong(long address,
long i64) |
void |
writeVolatileLong(Object object,
long offset,
long i64) |
void |
writeVolatileShort(long address,
short i16) |
void |
writeVolatileShort(Object object,
long offset,
short i16) |
public static final UnsafeMemory INSTANCE
public static UnsafeMemory[] values()
for (UnsafeMemory c : UnsafeMemory.values()) System.out.println(c);
public static UnsafeMemory valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is null@NotNull public <E> E allocateInstance(Class<? extends E> clazz) throws InstantiationException
allocateInstance in interface MemoryInstantiationExceptionpublic long getFieldOffset(Field field)
getFieldOffset in interface Memorypublic void setInt(@NotNull
Object object,
long offset,
int value)
@NotNull
public <T> T getObject(@NotNull
Object object,
long offset)
public void storeFence()
storeFence in interface Memorypublic void setMemory(long address,
long size,
byte b)
public void freeMemory(long address,
long size)
freeMemory in interface Memorypublic long allocate(long capacity)
throws IllegalArgumentException
allocate in interface MemoryIllegalArgumentExceptionpublic long nativeMemoryUsed()
nativeMemoryUsed in interface Memorypublic void writeByte(@NotNull
Object object,
long offset,
byte b)
public byte readByte(@NotNull
Object object,
long offset)
public void writeShort(long address,
short i16)
writeShort in interface Memorypublic void writeShort(@NotNull
Object object,
long offset,
short i16)
writeShort in interface Memorypublic short readShort(@NotNull
Object object,
long offset)
public void writeInt(@NotNull
Object object,
long offset,
int i32)
public void writeOrderedInt(long address,
int i32)
writeOrderedInt in interface Memorypublic void writeOrderedInt(@NotNull
Object object,
long offset,
int i32)
writeOrderedInt in interface Memorypublic int readInt(@NotNull
Object object,
long offset)
public void writeLong(@NotNull
Object object,
long offset,
long i64)
public long readLong(@NotNull
Object object,
long offset)
public void writeFloat(long address,
float f)
writeFloat in interface Memorypublic void writeFloat(@NotNull
Object object,
long offset,
float f)
writeFloat in interface Memorypublic float readFloat(@NotNull
Object object,
long offset)
public void writeDouble(long address,
double d)
writeDouble in interface Memorypublic void writeDouble(@NotNull
Object object,
long offset,
double d)
writeDouble in interface Memorypublic double readDouble(long address)
readDouble in interface Memorypublic double readDouble(@NotNull
Object object,
long offset)
readDouble in interface Memorypublic void copyMemory(byte[] bytes,
int offset,
long address,
int length)
copyMemory in interface Memorypublic void copyMemory(long fromAddress,
long address,
long length)
copyMemory in interface Memorypublic void copyMemory(byte[] bytes,
int offset,
Object obj2,
long offset2,
int length)
copyMemory in interface Memorypublic void copyMemory(long fromAddress,
Object obj2,
long offset2,
int length)
copyMemory in interface Memorypublic void writeOrderedLong(long address,
long i)
writeOrderedLong in interface Memorypublic void writeOrderedLong(@NotNull
Object object,
long offset,
long i)
writeOrderedLong in interface Memorypublic boolean compareAndSwapInt(long address,
int expected,
int value)
compareAndSwapInt in interface Memorypublic boolean compareAndSwapInt(@NotNull
Object object,
long offset,
int expected,
int value)
compareAndSwapInt in interface Memorypublic boolean compareAndSwapLong(long address,
long expected,
long value)
compareAndSwapLong in interface Memorypublic boolean compareAndSwapLong(@NotNull
Object object,
long offset,
long expected,
long value)
compareAndSwapLong in interface Memorypublic byte readVolatileByte(long address)
readVolatileByte in interface Memorypublic byte readVolatileByte(@NotNull
Object object,
long offset)
readVolatileByte in interface Memorypublic short readVolatileShort(long address)
readVolatileShort in interface Memorypublic short readVolatileShort(@NotNull
Object object,
long offset)
readVolatileShort in interface Memorypublic int readVolatileInt(long address)
readVolatileInt in interface Memorypublic int readVolatileInt(@NotNull
Object object,
long offset)
readVolatileInt in interface Memorypublic float readVolatileFloat(long address)
readVolatileFloat in interface Memorypublic float readVolatileFloat(@NotNull
Object object,
long offset)
readVolatileFloat in interface Memorypublic long readVolatileLong(long address)
readVolatileLong in interface Memorypublic long readVolatileLong(@NotNull
Object object,
long offset)
readVolatileLong in interface Memorypublic double readVolatileDouble(long address)
readVolatileDouble in interface Memorypublic double readVolatileDouble(@NotNull
Object object,
long offset)
readVolatileDouble in interface Memorypublic void writeVolatileByte(long address,
byte b)
writeVolatileByte in interface Memorypublic void writeVolatileByte(@NotNull
Object object,
long offset,
byte b)
writeVolatileByte in interface Memorypublic void writeVolatileShort(long address,
short i16)
writeVolatileShort in interface Memorypublic void writeVolatileShort(@NotNull
Object object,
long offset,
short i16)
writeVolatileShort in interface Memorypublic void writeVolatileInt(long address,
int i32)
writeVolatileInt in interface Memorypublic void writeVolatileInt(@NotNull
Object object,
long offset,
int i32)
writeVolatileInt in interface Memorypublic void writeVolatileFloat(long address,
float f)
writeVolatileFloat in interface Memorypublic void writeVolatileFloat(@NotNull
Object object,
long offset,
float f)
writeVolatileFloat in interface Memorypublic void writeVolatileLong(long address,
long i64)
writeVolatileLong in interface Memorypublic void writeVolatileLong(@NotNull
Object object,
long offset,
long i64)
writeVolatileLong in interface Memorypublic void writeVolatileDouble(long address,
double d)
writeVolatileDouble in interface Memorypublic void writeVolatileDouble(@NotNull
Object object,
long offset,
double d)
writeVolatileDouble in interface Memorypublic int addInt(@NotNull
Object object,
long offset,
int increment)
Copyright © 2018. All rights reserved.