Annotation Interface RawPointerTo


@Retention(RUNTIME) @Target(TYPE) public @interface RawPointerTo
Denotes a Java interface that is a pointer to a RawStructure. The interface must extend PointerBase, i.e., it is a word type. There is never a Java class that implements the interface.

If the method has a non-void return type that is not the annotated interface, it is a read-method of the pointer. Calls of the method are replaced with a memory read. The possible signatures are ValueType read([IntType index], [LocationIdentity locationIdentity]);

If the method has the return type void, it is a write-method of the pointer. Calls of the method are replaced with a memory write. The possible signatures are void write([IntType index], ValueType value, [LocationIdentity locationIdentity]);

If the return type of the method is the annotated interface, it is an address computation for an array access. Calls of the method are replaced with address arithmetic. The possible signatures are PointerType addressOf(IntType index);

The receiver is the pointer that is accessed, i.e., the base address of the memory access.

The ValueType must be the Java-equivalent of the C type used in the pointer definition.

The optional parameter index (always the first parameter when it is present) denotes an index, i.e., the receiver is treated as an array of the pointers. The type must be a primitive integer type or a word type. Address arithmetic is used to scale the index with the size of the value type.

The optional parameter locationIdentity specifies the LocationIdentity to be used for the memory access. Two memory accesses with two different location identities are guaranteed to not alias. The parameter cannot be used together with the UniqueLocationIdentity annotation, which is another way of providing a location identity for the memory access.

Since:
21.2
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends WordBase>
    The value type, as a reference to a Java interface that is annotated with RawStructure or RawPointerTo.
  • Element Details

    • value

      Class<? extends WordBase> value
      The value type, as a reference to a Java interface that is annotated with RawStructure or RawPointerTo.
      Since:
      21.2
      Default:
      org.graalvm.word.WordBase.class