# Uses of Interface
java.lang.foreign.Arena

Packages that use Arena
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 Arena in java.lang.foreign

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

- ## Uses of Arena in java.nio.channels

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