# Uses of Interface
java.lang.foreign.Arena

Packages that use ArenaPREVIEW
Package
Description
java.lang.foreign
Provides low-level access to memory and functions outside the Java runtime.
java.nio.channels
Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.

## Uses of ArenaPREVIEW in java.lang.foreign

Methods in java.lang.foreign that return ArenaPREVIEW
Modifier and Type
Method
Description
`static ArenaPREVIEW`
Arena.`global()`
Obtains the global arena.
`static ArenaPREVIEW`
Arena.`ofAuto()`
Creates a new arena that is managed, automatically, by the garbage collector.
`static ArenaPREVIEW`
Arena.`ofConfined()`
Returns a new confined arena.
`static ArenaPREVIEW`
Arena.`ofShared()`
Returns a new shared arena.
Methods in java.lang.foreign with parameters of type ArenaPREVIEW
Modifier and Type
Method
Description
`static SymbolLookupPREVIEW`
SymbolLookup.`libraryLookup(String name, ArenaPREVIEW arena)`
Loads a library with the given name (if not already loaded) and creates a symbol lookup for symbols in that library.
`static SymbolLookupPREVIEW`
SymbolLookup.`libraryLookup(Path path, ArenaPREVIEW arena)`
Loads a library from the given path (if not already loaded) and creates a symbol lookup for symbols in that library.
`MemorySegmentPREVIEW`
MemorySegment.`reinterpret(long newSize, ArenaPREVIEW arena, Consumer<MemorySegmentPREVIEW> cleanup)`
Returns a new segment with the same address as this segment, but with the provided size and scope.
`MemorySegmentPREVIEW`
MemorySegment.`reinterpret(ArenaPREVIEW arena, Consumer<MemorySegmentPREVIEW> cleanup)`
Returns a new memory segment with the same address and size as this segment, but with the provided scope.
`MemorySegmentPREVIEW`
Linker.`upcallStub(MethodHandle target, FunctionDescriptorPREVIEW function, ArenaPREVIEW arena, Linker.OptionPREVIEW... options)`
Creates an upcall stub which can be passed to other foreign functions as a function pointer, associated with the given arena.

## Uses of ArenaPREVIEW in java.nio.channels

Methods in java.nio.channels with parameters of type ArenaPREVIEW
Modifier and Type
Method
Description
`MemorySegmentPREVIEW`
FileChannel.`map(FileChannel.MapMode mode, long offset, long size, ArenaPREVIEW arena)`
Preview.
Maps a region of this channel's file into a new mapped memory segment, with the given offset, size and arena.