java.lang.Object
overrungl.Pointer
- All Implemented Interfaces:
Addressable
- Direct Known Subclasses:
MemoryStackPREVIEW
,Struct
Pointer
relies on preview features of the Java platform:
Pointer
refers to one or more preview APIs:MemoryLayout
,MemorySegment
,SegmentAllocator
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A
MemorySegment
PREVIEW wrapper with a segment allocator.- Since:
- 0.1.0
- Author:
- squid233
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MemorySegmentPREVIEW
The pointer address.protected final SegmentAllocatorPREVIEW
The allocator of this pointer.protected MemorySegmentPREVIEW
The managed native segment that is not zero-length. -
Constructor Summary
ConstructorDescriptionPointer
(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator) Create the pointer instance. -
Method Summary
Modifier and TypeMethodDescriptionaddress()
Returns the raw address value.Returns the allocator of this pointer.segment
(long byteSize) Gets the native segment of this pointer, or creates a new one if the segment of this pointer is zero-length.segment
(MemoryLayoutPREVIEW layout) Gets the native segment of this pointer, or creates a new one if the segment of this pointer is zero-length.
-
Field Details
-
address
The pointer address. -
allocator
The allocator of this pointer. -
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
-
Pointer
Create the pointer instance.- Parameters:
address
- the address.allocator
- the allocator of this address.
-
-
Method Details
-
address
Description copied from interface:Addressable
Returns the raw address value.- Specified by:
address
in interfaceAddressable
- Returns:
- the raw address value
-
allocator
Returns the allocator of this pointer.- Returns:
- the allocator of this pointer
-
segment
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
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:
-
Pointer
when preview features are enabled.