Package overrungl

Class Pointer

java.lang.Object
overrungl.Pointer
All Implemented Interfaces:
Addressable
Direct Known Subclasses:
MemoryStackPREVIEW, Struct

public class Pointer extends Object implements Addressable
Pointer relies on preview features of the Java platform:
Programs can only use Pointer when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A MemorySegmentPREVIEW wrapper with a segment allocator.
Since:
0.1.0
Author:
squid233
  • Field Details

    • address

      protected final MemorySegmentPREVIEW address
      The pointer address.
    • allocator

      protected final SegmentAllocatorPREVIEW allocator
      The allocator of this pointer.
    • managedSegment

      protected MemorySegmentPREVIEW managedSegment
      The managed native segment that is not zero-length.

      This field is not modified with final since the layout might be null in construction.

  • Constructor Details

  • Method Details

    • address

      public MemorySegmentPREVIEW address()
      Description copied from interface: Addressable
      Returns the raw address value.
      Specified by:
      address in interface Addressable
      Returns:
      the raw address value
    • allocator

      public SegmentAllocatorPREVIEW allocator()
      Returns the allocator of this pointer.
      Returns:
      the allocator of this pointer
    • segment

      public MemorySegmentPREVIEW segment(long byteSize)
      Gets the native segment of this pointer, or creates a new one if the segment of this pointer is zero-length.
      Parameters:
      byteSize - the byte size of the segment.
      Returns:
      the memory segment.
      See Also:
    • segment

      public MemorySegmentPREVIEW segment(MemoryLayoutPREVIEW layout)
      Gets the native segment of this pointer, or creates a new one if the segment of this pointer is zero-length.
      Parameters:
      layout - the memory layout of the segment.
      Returns:
      the memory segment.
      See Also: