Top Description Methods
org.graalvm.word

public Interface Pointer

extends UnsignedWord, PointerBase

Lowest-level memory access of native C memory.

Do not use these methods to access Java objects. These methods access the raw memory without any null checks, read- or write barriers. Even when the VM uses compressed pointers, then readObject and writeObject methods access uncompressed pointers.

Since
19.0

Method Summary

Modifier and TypeMethod and Description
public Pointer

Returns:

this + val
add
(UnsignedWord
value to be added to this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.add.

Returns a Pointer whose value is (this + val).

public Pointer

Returns:

this + val
add
(int
value to be added to this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.add.

Returns a Pointer whose value is (this + val).

public Pointer

Returns:

this & val
and
(UnsignedWord
value to be AND'ed with this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.and.

Returns a Pointer whose value is (this & val).

public Pointer

Returns:

this & val
and
(int
value to be AND'ed with this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.and.

Returns a Pointer whose value is (this & val).

public int

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapInt
(WordBase
the signed offset for the memory access
offset
,
int
the expected current value at the memory address
expectedValue
,
int
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public int

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapInt
(int
the signed offset for the memory access
offset
,
int
the expected current value at the memory address
expectedValue
,
int
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public long

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapLong
(WordBase
the signed offset for the memory access
offset
,
long
the expected current value at the memory address
expectedValue
,
long
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public long

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapLong
(int
the signed offset for the memory access
offset
,
long
the expected current value at the memory address
expectedValue
,
long
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public Object

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapObject
(WordBase
the signed offset for the memory access
offset
,
Object
the expected current value at the memory address
expectedValue
,
Object
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public Object

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapObject
(int
the signed offset for the memory access
offset
,
Object
the expected current value at the memory address
expectedValue
,
Object
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public <T extends WordBase> T

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapWord
(WordBase
the signed offset for the memory access
offset
,
T
the expected current value at the memory address
expectedValue
,
T
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public <T extends WordBase> T

Returns:

The value that was read for comparison, which is expectedValue if the exchange was performed.
compareAndSwapWord
(int
the signed offset for the memory access
offset
,
T
the expected current value at the memory address
expectedValue
,
T
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public void
initializeLong(WordBase
the signed offset for the memory access
offset
,
long
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Initializes the memory at address (this + offset).

public void
initializeLong(int
the signed offset for the memory access
offset
,
long
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Initializes the memory at address (this + offset).

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapInt
(WordBase
the signed offset for the memory access
offset
,
int
the expected current value at the memory address
expectedValue
,
int
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapInt
(int
the signed offset for the memory access
offset
,
int
the expected current value at the memory address
expectedValue
,
int
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapLong
(WordBase
the signed offset for the memory access
offset
,
long
the expected current value at the memory address
expectedValue
,
long
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapLong
(int
the signed offset for the memory access
offset
,
long
the expected current value at the memory address
expectedValue
,
long
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapObject
(WordBase
the signed offset for the memory access
offset
,
Object
the expected current value at the memory address
expectedValue
,
Object
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapObject
(int
the signed offset for the memory access
offset
,
Object
the expected current value at the memory address
expectedValue
,
Object
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapWord
(WordBase
the signed offset for the memory access
offset
,
WordBase
the expected current value at the memory address
expectedValue
,
WordBase
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public boolean

Returns:

true if successful. False return indicates that the actual value was not equal to the expected value.
logicCompareAndSwapWord
(int
the signed offset for the memory access
offset
,
WordBase
the expected current value at the memory address
expectedValue
,
WordBase
the new value for the atomic exchange
newValue
,
LocationIdentity
the identity of the memory location
locationIdentity
)

In a single atomic step, compares the memory at address (this + offset) to the expected value, and if equal, exchanges it for the new value.

public Pointer

Returns:

this | val
or
(UnsignedWord
value to be OR'ed with this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.or.

Returns a Pointer whose value is (this | val).

public Pointer

Returns:

this | val
or
(int
value to be OR'ed with this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.or.

Returns a Pointer whose value is (this | val).

public byte

Returns:

the result of the memory access
readByte
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public byte

Returns:

the result of the memory access
readByte
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public byte

Returns:

the result of the memory access
readByte
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public byte

Returns:

the result of the memory access
readByte
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public char

Returns:

the result of the memory access
readChar
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public char

Returns:

the result of the memory access
readChar
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public char

Returns:

the result of the memory access
readChar
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public char

Returns:

the result of the memory access
readChar
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public double

Returns:

the result of the memory access
readDouble
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public double

Returns:

the result of the memory access
readDouble
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public double

Returns:

the result of the memory access
readDouble
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public double

Returns:

the result of the memory access
readDouble
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public float

Returns:

the result of the memory access
readFloat
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public float

Returns:

the result of the memory access
readFloat
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public float

Returns:

the result of the memory access
readFloat
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public float

Returns:

the result of the memory access
readFloat
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public int

Returns:

the result of the memory access
readInt
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public int

Returns:

the result of the memory access
readInt
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public int

Returns:

the result of the memory access
readInt
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public int

Returns:

the result of the memory access
readInt
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public long

Returns:

the result of the memory access
readLong
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public long

Returns:

the result of the memory access
readLong
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public long

Returns:

the result of the memory access
readLong
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public long

Returns:

the result of the memory access
readLong
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public Object

Returns:

the result of the memory access
readObject
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public Object

Returns:

the result of the memory access
readObject
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public Object

Returns:

the result of the memory access
readObject
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public Object

Returns:

the result of the memory access
readObject
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public short

Returns:

the result of the memory access
readShort
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public short

Returns:

the result of the memory access
readShort
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public short

Returns:

the result of the memory access
readShort
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public short

Returns:

the result of the memory access
readShort
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public <T extends WordBase> T

Returns:

the result of the memory access
readWord
(WordBase
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public <T extends WordBase> T

Returns:

the result of the memory access
readWord
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset).

public <T extends WordBase> T

Returns:

the result of the memory access
readWord
(WordBase
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public <T extends WordBase> T

Returns:

the result of the memory access
readWord
(int
the signed offset for the memory access
offset
)

Reads the memory at address (this + offset).

public <T extends WordBase> T

Returns:

the result of the memory access
readWordVolatile
(int
the signed offset for the memory access
offset
,
LocationIdentity
the identity of the read
locationIdentity
)

Reads the memory at address (this + offset) in accordance with the volatile semantics.

public Pointer

Returns:

this - val
subtract
(UnsignedWord
value to be subtracted from this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.subtract.

Returns a Pointer whose value is (this - val).

public Pointer

Returns:

this - val
subtract
(int
value to be subtracted from this Pointer.
val
)

Redeclares org.graalvm.word.UnsignedWord.subtract.

Returns a Pointer whose value is (this - val).

public Object

Returns:

this Pointer cast to Object.
toObject
()

Unsafe conversion of this Pointer to a Java language object.

public <T> T

Returns:

this Pointer cast to type T
toObject
(Class<T>
the type to which to cast the pointer
clazz
,
boolean
true if the value cannot be null
nonNull
)

Convert pointer to the type specified by the clazz argument.

public Object

Returns:

this Pointer cast to non-null Object.
toObjectNonNull
()

Unsafe conversion of this Pointer to a Java language object.

public void
writeByte(WordBase
the signed offset for the memory access
offset
,
byte
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeByte(int
the signed offset for the memory access
offset
,
byte
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeByte(WordBase
the signed offset for the memory access
offset
,
byte
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeByte(int
the signed offset for the memory access
offset
,
byte
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeChar(WordBase
the signed offset for the memory access
offset
,
char
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeChar(int
the signed offset for the memory access
offset
,
char
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeChar(WordBase
the signed offset for the memory access
offset
,
char
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeChar(int
the signed offset for the memory access
offset
,
char
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeDouble(WordBase
the signed offset for the memory access
offset
,
double
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeDouble(int
the signed offset for the memory access
offset
,
double
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeDouble(WordBase
the signed offset for the memory access
offset
,
double
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeDouble(int
the signed offset for the memory access
offset
,
double
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeFloat(WordBase
the signed offset for the memory access
offset
,
float
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeFloat(int
the signed offset for the memory access
offset
,
float
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeFloat(WordBase
the signed offset for the memory access
offset
,
float
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeFloat(int
the signed offset for the memory access
offset
,
float
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeInt(WordBase
the signed offset for the memory access
offset
,
int
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeInt(int
the signed offset for the memory access
offset
,
int
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeInt(WordBase
the signed offset for the memory access
offset
,
int
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeInt(int
the signed offset for the memory access
offset
,
int
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeLong(WordBase
the signed offset for the memory access
offset
,
long
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeLong(int
the signed offset for the memory access
offset
,
long
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeLong(WordBase
the signed offset for the memory access
offset
,
long
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeLong(int
the signed offset for the memory access
offset
,
long
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeObject(WordBase
the signed offset for the memory access
offset
,
Object
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeObject(int
the signed offset for the memory access
offset
,
Object
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeObject(WordBase
the signed offset for the memory access
offset
,
Object
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeObject(int
the signed offset for the memory access
offset
,
Object
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeShort(WordBase
the signed offset for the memory access
offset
,
short
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeShort(int
the signed offset for the memory access
offset
,
short
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeShort(WordBase
the signed offset for the memory access
offset
,
short
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeShort(int
the signed offset for the memory access
offset
,
short
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeWord(WordBase
the signed offset for the memory access
offset
,
WordBase
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeWord(int
the signed offset for the memory access
offset
,
WordBase
the value to be written to memory
val
,
LocationIdentity
the identity of the write
locationIdentity
)

Writes the memory at address (this + offset).

public void
writeWord(WordBase
the signed offset for the memory access
offset
,
WordBase
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeWord(int
the signed offset for the memory access
offset
,
WordBase
the value to be written to memory
val
)

Writes the memory at address (this + offset).

public void
writeWordVolatile(int
the signed offset for the memory access
offset
,
WordBase
the value to be written to memory
val
)

Writes the memory at address (this + offset) in accordance with the volatile semantics.

Inherited from org.graalvm.word.PointerBase:
isNonNullisNull
Inherited from org.graalvm.word.UnsignedWord:
aboveOrEqualaboveOrEqualaboveThanaboveThanbelowOrEqualbelowOrEqualbelowThanbelowThanequalequalmultiplymultiplynotnotEqualnotEqualshiftLeftshiftLeftunsignedDivideunsignedDivideunsignedRemainderunsignedRemainderunsignedShiftRightunsignedShiftRightxorxor