# Preview API

Show preview API for:

- 434: Foreign Function & Memory API (Second Preview)
- 436: Virtual Threads (Second Preview)

## Contents

- Interfaces
- Enum Classes
- Methods

- Interfaces
  Interface
  Preview Feature
  Description
  java.lang.foreign.ArenaPREVIEW
  Foreign Function & Memory API
  An arena controls the lifecycle of memory segments, providing both flexible allocation and timely deallocation.
  java.lang.foreign.FunctionDescriptorPREVIEW
  Foreign Function & Memory API
  A function descriptor models the signature of foreign functions.
  java.lang.foreign.GroupLayoutPREVIEW
  Foreign Function & Memory API
  A compound layout that aggregates multiple member layouts.
  java.lang.foreign.LinkerPREVIEW
  Foreign Function & Memory API
  A linker provides access to foreign functions from Java code, and access to Java code from foreign functions.
  java.lang.foreign.Linker.OptionPREVIEW
  Foreign Function & Memory API
  A linker option is used to indicate additional linking requirements to the linker, besides what is described by a function descriptor.
  java.lang.foreign.Linker.Option.CaptureCallStatePREVIEW
  Foreign Function & Memory API
  A linker option for saving portions of the execution state immediately after calling a foreign function associated with a downcall method handle, before it can be overwritten by the runtime, or read through conventional means.
  java.lang.foreign.MemoryLayoutPREVIEW
  Foreign Function & Memory API
  A memory layout describes the contents of a memory segment.
  java.lang.foreign.MemoryLayout.PathElementPREVIEW
  Foreign Function & Memory API
  An element in a layout path.
  java.lang.foreign.MemorySegmentPREVIEW
  Foreign Function & Memory API
  A memory segment provides access to a contiguous region of memory.
  java.lang.foreign.PaddingLayoutPREVIEW
  Foreign Function & Memory API
  A padding layout.
  java.lang.foreign.SegmentAllocatorPREVIEW
  Foreign Function & Memory API
  An object that may be used to allocate memory segmentsPREVIEW.
  java.lang.foreign.SegmentScopePREVIEW
  Foreign Function & Memory API
  A segment scope controls access to memory segments.
  java.lang.foreign.SequenceLayoutPREVIEW
  Foreign Function & Memory API
  A compound layout that denotes a repetition of a given element layout.
  java.lang.foreign.StructLayoutPREVIEW
  Foreign Function & Memory API
  A group layout whose member layouts are laid out one after the other.
  java.lang.foreign.SymbolLookupPREVIEW
  Foreign Function & Memory API
  A symbol lookup retrieves the address of a symbol in one or more libraries.
  java.lang.foreign.UnionLayoutPREVIEW
  Foreign Function & Memory API
  A group layout whose member layouts are laid out at the same starting offset.
  java.lang.foreign.VaListPREVIEW
  Foreign Function & Memory API
  Helper class to create and manipulate variable argument lists, similar in functionality to a C `va_list`.
  java.lang.foreign.VaList.BuilderPREVIEW
  Foreign Function & Memory API
  A builder used to construct a variable argument listPREVIEW.
  java.lang.foreign.ValueLayoutPREVIEW
  Foreign Function & Memory API
  A layout that models values of basic data types.
  java.lang.foreign.ValueLayout.OfAddressPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `MemorySegment.class`.
  java.lang.foreign.ValueLayout.OfBooleanPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `boolean.class`.
  java.lang.foreign.ValueLayout.OfBytePREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `byte.class`.
  java.lang.foreign.ValueLayout.OfCharPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `char.class`.
  java.lang.foreign.ValueLayout.OfDoublePREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `double.class`.
  java.lang.foreign.ValueLayout.OfFloatPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `float.class`.
  java.lang.foreign.ValueLayout.OfIntPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `int.class`.
  java.lang.foreign.ValueLayout.OfLongPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `long.class`.
  java.lang.foreign.ValueLayout.OfShortPREVIEW
  Foreign Function & Memory API
  A value layout whose carrier is `short.class`.
  java.lang.Thread.BuilderPREVIEW
  Virtual Threads
  A builder for `Thread` and `ThreadFactory` objects.
  java.lang.Thread.Builder.OfPlatformPREVIEW
  Virtual Threads
  A builder for creating a platform `Thread` or `ThreadFactory` that creates platform threads.
  java.lang.Thread.Builder.OfVirtualPREVIEW
  Virtual Threads
  A builder for creating a virtual `Thread` or `ThreadFactory` that creates virtual threads.

- Enum Classes
  Enum Class
  Preview Feature
  Description
  com.sun.management.HotSpotDiagnosticMXBean.ThreadDumpFormatPREVIEW
  Virtual Threads
  Thread dump format.

- Methods
  Method
  Preview Feature
  Description
  com.sun.jdi.request.ThreadDeathRequest.addPlatformThreadsOnlyFilter()PREVIEW
  Virtual Threads
  Restricts the events generated by this request to only platform threads.
  com.sun.jdi.request.ThreadStartRequest.addPlatformThreadsOnlyFilter()PREVIEW
  Virtual Threads
  Restricts the events generated by this request to only platform threads.
  com.sun.jdi.ThreadReference.isVirtual()PREVIEW
  Virtual Threads
  Returns `true` if the thread is a virtual thread.
  com.sun.management.HotSpotDiagnosticMXBean.dumpThreads(String, HotSpotDiagnosticMXBean.ThreadDumpFormat)PREVIEW
  Virtual Threads
  Generate a thread dump to the given file in the given format.
  java.lang.invoke.MethodHandles.collectCoordinates(VarHandle, int, MethodHandle)PREVIEW
  Foreign Function & Memory API
  Adapts a target var handle by pre-processing a sub-sequence of its coordinate values with a filter (a method handle).
  java.lang.invoke.MethodHandles.dropCoordinates(VarHandle, int, Class<?>...)PREVIEW
  Foreign Function & Memory API
  Returns a var handle which will discard some dummy coordinates before delegating to the target var handle.
  java.lang.invoke.MethodHandles.filterCoordinates(VarHandle, int, MethodHandle...)PREVIEW
  Foreign Function & Memory API
  Adapts a target var handle by pre-processing incoming coordinate values using unary filter functions.
  java.lang.invoke.MethodHandles.filterValue(VarHandle, MethodHandle, MethodHandle)PREVIEW
  Foreign Function & Memory API
  Adapts a target var handle by pre-processing incoming and outgoing values using a pair of filter functions.
  java.lang.invoke.MethodHandles.insertCoordinates(VarHandle, int, Object...)PREVIEW
  Foreign Function & Memory API
  Provides a target var handle with one or more bound coordinates in advance of the var handle's invocation.
  java.lang.invoke.MethodHandles.memorySegmentViewVarHandle(ValueLayout)PREVIEW
  Foreign Function & Memory API
  Creates a var handle object, which can be used to dereference a memory segmentPREVIEW by viewing its contents as a sequence of the provided value layout.
  java.lang.invoke.MethodHandles.permuteCoordinates(VarHandle, List<Class<?>>, int...)PREVIEW
  Foreign Function & Memory API
  Provides a var handle which adapts the coordinate values of the target var handle, by re-arranging them so that the new coordinates match the provided ones.
  java.lang.Module.isNativeAccessEnabled()PREVIEW
  Foreign Function & Memory API
  Returns `true` if this module can access restricted methods.
  java.lang.ModuleLayer.Controller.enableNativeAccess(Module)PREVIEW
  Foreign Function & Memory API
  Enables native access for a module in the layer if the caller's module has native access.
  java.lang.Thread.isVirtual()PREVIEW
  Virtual Threads
  Returns `true` if this thread is a virtual thread.
  java.lang.Thread.ofPlatform()PREVIEW
  Virtual Threads
  Returns a builder for creating a platform `Thread` or `ThreadFactory` that creates platform threads.
  java.lang.Thread.ofVirtual()PREVIEW
  Virtual Threads
  Returns a builder for creating a virtual `Thread` or `ThreadFactory` that creates virtual threads.
  java.lang.Thread.startVirtualThread(Runnable)PREVIEW
  Virtual Threads
  Creates a virtual thread to execute a task and schedules it to execute.
  java.nio.channels.FileChannel.map(FileChannel.MapMode, long, long, SegmentScope)PREVIEW
  Foreign Function & Memory API
  Maps a region of this channel's file into a new mapped memory segment, with the given offset, size and memory session.
  java.util.concurrent.Executors.newThreadPerTaskExecutor(ThreadFactory)PREVIEW
  Virtual Threads
  Creates an Executor that starts a new Thread for each task.
  java.util.concurrent.Executors.newVirtualThreadPerTaskExecutor()PREVIEW
  Virtual Threads
  Creates an Executor that starts a new virtual Thread for each task.
  jdk.jfr.consumer.RecordedThread.isVirtual()PREVIEW
  Virtual Threads
  Returns `true` if this is a virtual Thread, `false` otherwise.