APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.foreign

public final Class ArenaImpl

extends Object
implements Arena
Class Inheritance
All Implemented Interfaces
java.lang.foreign.Arena, java.lang.AutoCloseable, java.lang.foreign.SegmentAllocator
Imports
java.lang.foreign.Arena, .MemorySegment.Scope

Field Summary

Modifier and TypeField and Description
private final MemorySessionImpl
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public NativeMemorySegmentImpl
allocate(long byteSize, long byteAlignment)

Implements java.lang.foreign.Arena.allocate.

Returns a native memory segment with the given size (in bytes) and alignment constraint (in bytes).

public NativeMemorySegmentImpl
allocateNoInit(long byteSize, long byteAlignment)

public void
close()

Implements java.lang.foreign.Arena.close.

Closes this arena.

public MemorySegment.Scope
scope()

Implements java.lang.foreign.Arena.scope.

Returns the arena scope.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sessionback to summary
private final MemorySessionImpl session
shouldReserveMemoryback to summary
private final boolean shouldReserveMemory

Constructor Detail

ArenaImplback to summary
pack-priv ArenaImpl(MemorySessionImpl session)

Method Detail

allocateback to summary
public NativeMemorySegmentImpl allocate(long byteSize, long byteAlignment)

Implements java.lang.foreign.Arena.allocate.

Doc from java.lang.foreign.Arena.allocate.

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 address is the starting address of the allocated off-heap region of memory backing the segment, and the address is aligned according the provided alignment constraint.

Annotations
@Override
allocateNoInitback to summary
public NativeMemorySegmentImpl allocateNoInit(long byteSize, long byteAlignment)
closeback to summary
public void close()

Implements java.lang.foreign.Arena.close.

Doc from java.lang.foreign.Arena.close.

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.

Annotations
@Override
scopeback to summary
public MemorySegment.Scope scope()

Implements java.lang.foreign.Arena.scope.

Doc from java.lang.foreign.Arena.scope.

Returns the arena scope.

Annotations
@Override