HeapMemorySegmentImpl are defined (e.g. OfFloat), so that each subclass can override the
HeapMemorySegmentImpl#unsafeGetBase() method so that it returns an array of the correct (sharp) type. Note that
the field type storing the 'base' coordinate is just Object; similarly, all the constructor in the subclasses
accept an Object 'base' parameter instead of a sharper type (e.g. byte[]). This is deliberate, as
using sharper types would require use of type-conversions, which in turn would inhibit some C2 optimizations,
such as the elimination of store barriers in methods like HeapMemorySegmentImpl#dup(long, long, boolean, MemorySessionImpl).
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| public static class | |
| public static class | |
| public static class | |
| public static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Object | |
| private static final long | |
| private static final long | |
| private static final long | |
| private static final long | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | HeapMemorySegmentImpl(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract HeapMemorySegmentImpl | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public Optional | heapBase()
Implements java. Returns the Java object stored in the on-heap region of memory backing this memory segment, if any. |
| pack-priv ByteBuffer | |
| public final long | maxByteAlignment()
Implements java. Returns the maximum byte alignment associated with this memory segment. |
| public long | unsafeGetOffset()
Implements abstract jdk.
|
| base | back to summary |
|---|---|
| pack-priv final Object base | |
| MAX_ALIGN_BYTE_ARRAY | back to summary |
|---|---|
| private static final long MAX_ALIGN_BYTE_ARRAY | |
| MAX_ALIGN_INT_ARRAY | back to summary |
|---|---|
| private static final long MAX_ALIGN_INT_ARRAY | |
| MAX_ALIGN_LONG_ARRAY | back to summary |
|---|---|
| private static final long MAX_ALIGN_LONG_ARRAY | |
| MAX_ALIGN_SHORT_ARRAY | back to summary |
|---|---|
| private static final long MAX_ALIGN_SHORT_ARRAY | |
| offset | back to summary |
|---|---|
| pack-priv final long offset | |
| HeapMemorySegmentImpl | back to summary |
|---|---|
pack-priv HeapMemorySegmentImpl(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session)
| |
| dup | back to summary |
|---|---|
| pack-priv abstract HeapMemorySegmentImpl dup(long offset, long size, boolean readOnly, MemorySessionImpl scope) Implements abstract jdk.
| |
| heapBase | back to summary |
|---|---|
| public Optional Implements java. Doc from java. Returns the Java object stored in the on-heap region of memory backing this memory
segment, if any. For instance, if this memory segment is a heap segment created
with the
| |
| makeByteBuffer | back to summary |
|---|---|
| pack-priv ByteBuffer makeByteBuffer() Implements abstract jdk.
| |
| maxByteAlignment | back to summary |
|---|---|
| public final long maxByteAlignment() Implements java. Doc from java. Returns the maximum byte alignment associated with this memory segment. The returned alignment is always a power of two and is derived from the segment address() and, if it is a heap segment, the type of the backing heap storage. This method can be used to ensure that a segment is sufficiently aligned with a layout: MemoryLayout layout = ... MemorySegment segment = ... if (segment.maxByteAlignment() < layout.byteAlignment()) { // Take action (e.g. throw an Exception) }
| |
| unsafeGetOffset | back to summary |
|---|---|
| public long unsafeGetOffset() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public byte[] |
| OfByte | back to summary |
|---|---|
| pack-priv OfByte(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public byte[] unsafeGetBase() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public char[] |
| OfChar | back to summary |
|---|---|
| pack-priv OfChar(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public char[] unsafeGetBase() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public double[] |
| OfDouble | back to summary |
|---|---|
| pack-priv OfDouble(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public double[] unsafeGetBase() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public float[] |
| OfFloat | back to summary |
|---|---|
| pack-priv OfFloat(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public float[] unsafeGetBase() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public int[] |
| OfInt | back to summary |
|---|---|
| pack-priv OfInt(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public int[] unsafeGetBase() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public long[] |
| OfLong | back to summary |
|---|---|
| pack-priv OfLong(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public long[] unsafeGetBase() Implements abstract jdk.
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | address()
Implements java. Returns the address of this memory segment. |
| pack-priv HeapMemorySegmentImpl. | dup(long offset, long size, boolean readOnly, MemorySessionImpl scope)
Implements abstract jdk.
|
| public long | |
| public short[] |
| OfShort | back to summary |
|---|---|
| pack-priv OfShort(long offset, Object base, long length, boolean readOnly, MemorySessionImpl session) | |
| address | back to summary |
|---|---|
| public long address() Implements java. Doc from java. Returns the address of this memory segment.
| |
| dup | back to summary |
|---|---|
| pack-priv HeapMemorySegmentImpl. Implements abstract jdk.
| |
| maxAlignMask | back to summary |
|---|---|
| public long maxAlignMask() Implements abstract jdk.
| |
| unsafeGetBase | back to summary |
|---|---|
| public short[] unsafeGetBase() Implements abstract jdk.
| |