Interface Pointer

All Superinterfaces:
ComparableWord, PointerBase, UnsignedWord, WordBase

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 Details

    • toObject

      Object toObject()
      Unsafe conversion of this Pointer to a Java language object. No correctness checks or type checks are performed. The caller must ensure that the Pointer contains a valid Java object that can i.e., processed by the garbage collector.
      Returns:
      this Pointer cast to Object.
      Since:
      19.0
    • toObject

      <T> T toObject(Class<T> clazz, boolean nonNull)
      Convert pointer to the type specified by the clazz argument.
      Parameters:
      clazz - the type to which to cast the pointer
      nonNull - true if the value cannot be null
      Returns:
      this Pointer cast to type T
      Since:
      23.1
    • toObjectNonNull

      Object toObjectNonNull()
      Unsafe conversion of this Pointer to a Java language object. No correctness checks or type checks are performed. The caller must ensure that the Pointer contains a valid Java object that can i.e., processed by the garbage collector and the Pointer does not contain 0.
      Returns:
      this Pointer cast to non-null Object.
      Since:
      19.0
    • readByte

      byte readByte(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readChar

      char readChar(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readShort

      short readShort(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readInt

      int readInt(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readLong

      long readLong(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readFloat

      float readFloat(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readDouble

      double readDouble(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readWord

      <T extends WordBase> T readWord(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readObject

      Object readObject(WordBase offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readByte

      byte readByte(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readChar

      char readChar(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readShort

      short readShort(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readInt

      int readInt(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readLong

      long readLong(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readFloat

      float readFloat(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readDouble

      double readDouble(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readWord

      <T extends WordBase> T readWord(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readObject

      Object readObject(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • readWordVolatile

      <T extends WordBase> T readWordVolatile(int offset, LocationIdentity locationIdentity)
      Reads the memory at address (this + offset) in accordance with the volatile semantics. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      locationIdentity - the identity of the read
      Returns:
      the result of the memory access
      Since:
      19.0
    • writeByte

      void writeByte(WordBase offset, byte val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeChar

      void writeChar(WordBase offset, char val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeShort

      void writeShort(WordBase offset, short val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeInt

      void writeInt(WordBase offset, int val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeLong

      void writeLong(WordBase offset, long val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeFloat

      void writeFloat(WordBase offset, float val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeDouble

      void writeDouble(WordBase offset, double val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeWord

      void writeWord(WordBase offset, WordBase val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • initializeLong

      void initializeLong(WordBase offset, long val, LocationIdentity locationIdentity)
      Initializes the memory at address (this + offset). Both the base address and offset are in bytes. The memory must be uninitialized or zero prior to this operation.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeObject

      void writeObject(WordBase offset, Object val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeByte

      void writeByte(int offset, byte val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeChar

      void writeChar(int offset, char val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeShort

      void writeShort(int offset, short val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeInt

      void writeInt(int offset, int val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeLong

      void writeLong(int offset, long val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeFloat

      void writeFloat(int offset, float val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeDouble

      void writeDouble(int offset, double val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeWord

      void writeWord(int offset, WordBase val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • initializeLong

      void initializeLong(int offset, long val, LocationIdentity locationIdentity)
      Initializes the memory at address (this + offset). Both the base address and offset are in bytes. The memory must be uninitialized or zero prior to this operation.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • writeObject

      void writeObject(int offset, Object val, LocationIdentity locationIdentity)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      locationIdentity - the identity of the write
      Since:
      19.0
    • readByte

      byte readByte(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readChar

      char readChar(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readShort

      short readShort(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readInt

      int readInt(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readLong

      long readLong(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readFloat

      float readFloat(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readDouble

      double readDouble(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readWord

      <T extends WordBase> T readWord(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readObject

      Object readObject(WordBase offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readByte

      byte readByte(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readChar

      char readChar(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readShort

      short readShort(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readInt

      int readInt(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readLong

      long readLong(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readFloat

      float readFloat(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readDouble

      double readDouble(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readWord

      <T extends WordBase> T readWord(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • readObject

      Object readObject(int offset)
      Reads the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      Returns:
      the result of the memory access
      Since:
      19.0
    • writeByte

      void writeByte(WordBase offset, byte val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeChar

      void writeChar(WordBase offset, char val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeShort

      void writeShort(WordBase offset, short val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeInt

      void writeInt(WordBase offset, int val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeLong

      void writeLong(WordBase offset, long val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeFloat

      void writeFloat(WordBase offset, float val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeDouble

      void writeDouble(WordBase offset, double val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeWord

      void writeWord(WordBase offset, WordBase val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeObject

      void writeObject(WordBase offset, Object val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • compareAndSwapInt

      int compareAndSwapInt(WordBase offset, int expectedValue, int newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • compareAndSwapLong

      long compareAndSwapLong(WordBase offset, long expectedValue, long newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • compareAndSwapWord

      <T extends WordBase> T compareAndSwapWord(WordBase offset, T expectedValue, T newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • compareAndSwapObject

      Object compareAndSwapObject(WordBase offset, Object expectedValue, Object newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • logicCompareAndSwapInt

      boolean logicCompareAndSwapInt(WordBase offset, int expectedValue, int newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • logicCompareAndSwapLong

      boolean logicCompareAndSwapLong(WordBase offset, long expectedValue, long newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • logicCompareAndSwapWord

      boolean logicCompareAndSwapWord(WordBase offset, WordBase expectedValue, WordBase newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • logicCompareAndSwapObject

      boolean logicCompareAndSwapObject(WordBase offset, Object expectedValue, Object newValue, LocationIdentity 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. Both the base address and offset are in bytes.

      The offset is always treated as a SignedWord value. However, the static type is WordBase to avoid the frequent casts of UnsignedWord values (where the caller knows that the highest-order bit of the unsigned value is never used).

      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • writeByte

      void writeByte(int offset, byte val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeChar

      void writeChar(int offset, char val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeShort

      void writeShort(int offset, short val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeInt

      void writeInt(int offset, int val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeLong

      void writeLong(int offset, long val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeFloat

      void writeFloat(int offset, float val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeDouble

      void writeDouble(int offset, double val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeWord

      void writeWord(int offset, WordBase val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeObject

      void writeObject(int offset, Object val)
      Writes the memory at address (this + offset). Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • writeWordVolatile

      void writeWordVolatile(int offset, WordBase val)
      Writes the memory at address (this + offset) in accordance with the volatile semantics. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      val - the value to be written to memory
      Since:
      19.0
    • compareAndSwapInt

      int compareAndSwapInt(int offset, int expectedValue, int newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • compareAndSwapLong

      long compareAndSwapLong(int offset, long expectedValue, long newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • compareAndSwapWord

      <T extends WordBase> T compareAndSwapWord(int offset, T expectedValue, T newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • compareAndSwapObject

      Object compareAndSwapObject(int offset, Object expectedValue, Object newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      The value that was read for comparison, which is expectedValue if the exchange was performed.
      Since:
      19.0
    • logicCompareAndSwapInt

      boolean logicCompareAndSwapInt(int offset, int expectedValue, int newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • logicCompareAndSwapLong

      boolean logicCompareAndSwapLong(int offset, long expectedValue, long newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • logicCompareAndSwapWord

      boolean logicCompareAndSwapWord(int offset, WordBase expectedValue, WordBase newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • logicCompareAndSwapObject

      boolean logicCompareAndSwapObject(int offset, Object expectedValue, Object newValue, LocationIdentity 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. Both the base address and offset are in bytes.
      Parameters:
      offset - the signed offset for the memory access
      expectedValue - the expected current value at the memory address
      newValue - the new value for the atomic exchange
      locationIdentity - the identity of the memory location
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.
      Since:
      19.0
    • add

      Returns a Pointer whose value is (this + val).
      Specified by:
      add in interface UnsignedWord
      Parameters:
      val - value to be added to this Pointer.
      Returns:
      this + val
      Since:
      19.0
    • add

      Pointer add(int val)
      Returns a Pointer whose value is (this + val).
      Specified by:
      add in interface UnsignedWord
      Parameters:
      val - value to be added to this Pointer.
      Returns:
      this + val
      Since:
      19.0
    • subtract

      Pointer subtract(UnsignedWord val)
      Returns a Pointer whose value is (this - val).
      Specified by:
      subtract in interface UnsignedWord
      Parameters:
      val - value to be subtracted from this Pointer.
      Returns:
      this - val
      Since:
      19.0
    • subtract

      Pointer subtract(int val)
      Returns a Pointer whose value is (this - val).
      Specified by:
      subtract in interface UnsignedWord
      Parameters:
      val - value to be subtracted from this Pointer.
      Returns:
      this - val
      Since:
      19.0
    • and

      Returns a Pointer whose value is (this & val).
      Specified by:
      and in interface UnsignedWord
      Parameters:
      val - value to be AND'ed with this Pointer.
      Returns:
      this & val
      Since:
      19.0
    • and

      Pointer and(int val)
      Returns a Pointer whose value is (this & val).
      Specified by:
      and in interface UnsignedWord
      Parameters:
      val - value to be AND'ed with this Pointer.
      Returns:
      this & val
      Since:
      19.0
    • or

      Returns a Pointer whose value is (this | val).
      Specified by:
      or in interface UnsignedWord
      Parameters:
      val - value to be OR'ed with this Pointer.
      Returns:
      this | val
      Since:
      19.0
    • or

      Pointer or(int val)
      Returns a Pointer whose value is (this | val).
      Specified by:
      or in interface UnsignedWord
      Parameters:
      val - value to be OR'ed with this Pointer.
      Returns:
      this | val
      Since:
      19.0