The foreign-function API now supports initializing the
thread-local execution state before downcalls. This complements the
preexisting call state capturing mechanism, which can already be
used to read thread-local execution state after downcalls. The
structure and contents of the execution state are
platform-dependent and described by
Linker.Option::captureStateLayout().
When call state capturing is enabled via
Linker.Option::captureCallState(String...
capturedState), a memory segment acts as a buffer for the
thread-local data. Prior to the downcall, the contents of the
buffer are used to initialize thread-local data. Immediately after
the downcall, the thread-local data is copied into the buffer.
Further information and a usage example can be found in the
Linker.Option::captureCallState(String...
capturedState) JavaDoc.