Use the factories BufferStack.of(...) to create new instances of this class.
Note
The reused segments are neither zeroed out before nor after re-use.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final long | |
| private final CarrierThreadLocal |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BufferStack | |
| public static BufferStack | |
| public static BufferStack | |
| public Arena | Returns: a new Arena that tries to providebyteSize and byteAlignment
allocations by recycling the BufferStack's internal memoryto be reserved from this BufferStack's internal memory byteSize, long to be used for reservation byteAlignment)Returns a new Arena that tries to provide |
| public Arena | Returns: a new Arena that tries to providebyteSize
allocations by recycling the BufferStack's internal memoryto be reserved from this BufferStack's internal memory byteSize)Returns a new Arena that tries to provide |
| public Arena | Returns: a new Arena that tries to providelayout
allocations by recycling the BufferStack's internal memoryfor which to reserve internal memory layout)Returns a new Arena that tries to provide |
| public String |
| byteAlignment | back to summary |
|---|---|
| private final long byteAlignment | |
| byteSize | back to summary |
|---|---|
| private final long byteSize | |
| tl | back to summary |
|---|---|
| private final CarrierThreadLocal<BufferStack. | |
| BufferStack | back to summary |
|---|---|
| private BufferStack(long byteSize, long byteAlignment) | |
| of | back to summary |
|---|---|
| public static BufferStack of(long byteSize, long byteAlignment) | |
| of | back to summary |
|---|---|
| public static BufferStack of(long byteSize) | |
| of | back to summary |
|---|---|
| public static BufferStack of(MemoryLayout layout) | |
| pushFrame | back to summary |
|---|---|
| public Arena pushFrame(long byteSize, long byteAlignment) Returns a new Arena that tries to provide
| |
| pushFrame | back to summary |
|---|---|
| public Arena pushFrame(long byteSize) Returns a new Arena that tries to provide
| |
| pushFrame | back to summary |
|---|---|
| public Arena pushFrame(MemoryLayout layout) Returns a new Arena that tries to provide
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Modifier and Type | Class and Description |
|---|---|
| private static record | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Arena | |
| private final BufferStack. | cleanupAction
Record Component accessed by cleanupAction(). |
| private final ReentrantLock | |
| private final SlicingAllocator |
| Access | Constructor and Description |
|---|---|
| private | PerThread(ReentrantLock lock, Arena arena, SlicingAllocator stack, BufferStack.
|
| Modifier and Type | Method and Description |
|---|---|
| public Arena | |
| public BufferStack. | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public ReentrantLock | |
| pack-priv static BufferStack. | |
| public Arena | |
| public SlicingAllocator | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| arena | back to summary |
|---|---|
| private final Arena arena Record Component accessed by arena(). | |
| cleanupAction | back to summary |
|---|---|
| private final BufferStack. Record Component accessed by cleanupAction(). | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock Record Component accessed by lock(). | |
| stack | back to summary |
|---|---|
| private final SlicingAllocator stack Record Component accessed by stack(). | |
| PerThread | back to summary |
|---|---|
| private PerThread(ReentrantLock lock, Arena arena, SlicingAllocator stack, BufferStack. | |
| arena | back to summary |
|---|---|
| public Arena arena() Record Component getter of arena. | |
| cleanupAction | back to summary |
|---|---|
| public BufferStack. Record Component getter of cleanupAction. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| lock | back to summary |
|---|---|
| public ReentrantLock lock() Record Component getter of lock. | |
| of | back to summary |
|---|---|
| pack-priv static BufferStack. | |
| pushFrame | back to summary |
|---|---|
public Arena pushFrame(long size, long byteAlignment)
| |
| stack | back to summary |
|---|---|
| public SlicingAllocator stack() Record Component getter of stack. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Arena |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(MemorySegment memorySegment)
Implements java. Performs this operation on the given argument. |
| public Arena | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public final int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| arena | back to summary |
|---|---|
| private final Arena arena Record Component accessed by arena(). | |
| CleanupAction | back to summary |
|---|---|
| private CleanupAction(Arena arena) | |
| accept | back to summary |
|---|---|
| public void accept(MemorySegment memorySegment) Implements java. Doc from java. Performs this operation on the given argument.
| |
| arena | back to summary |
|---|---|
| public Arena arena() Record Component getter of arena. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Arena | |
| private final SegmentAllocator | |
| private final boolean | |
| private final long | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public MemorySegment | allocate(long byteSize, long byteAlignment)
Implements java. Returns a native memory segment with the given size (in bytes) and alignment constraint (in bytes). |
| private void | |
| public void | |
| public MemorySegment. |
| confinedArena | back to summary |
|---|---|
| private final Arena confinedArena | |
| frame | back to summary |
|---|---|
| private final SegmentAllocator frame | |
| locked | back to summary |
|---|---|
| private final boolean locked | |
| parentOffset | back to summary |
|---|---|
| private final long parentOffset | |
| topOfStack | back to summary |
|---|---|
| private final long topOfStack | |
| Frame | back to summary |
|---|---|
public Frame(boolean locked, long byteSize, long byteAlignment)
| |
| allocate | back to summary |
|---|---|
| public MemorySegment allocate(long byteSize, long byteAlignment) Implements java. Doc from java. Returns a native memory segment with the given size (in bytes) and alignment
constraint (in bytes).
The returned segment is associated with this arena scope.
The segment's
| |
| assertOrder | back to summary |
|---|---|
private void assertOrder()
| |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this arena. If this method completes normally, the arena scope is no longer alive, and all the memory segments associated with it can no longer be accessed. Furthermore, any off-heap region of memory backing the segments obtained from this arena are also released.
| |
| scope | back to summary |
|---|---|
| public MemorySegment. Implements java. Doc from java. Returns the arena scope.
| |