Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
/ jdk20 Public archive

Commit 3918f9f

Browse files
committed
8299090: Specify coordinate order for additional CaptureCallState parameters on class as well
Reviewed-by: pminborg, mcimadamore
1 parent 945ef07 commit 3918f9f

File tree

1 file changed

+6
-2
lines changed
  • src/java.base/share/classes/java/lang/foreign

1 file changed

+6
-2
lines changed

src/java.base/share/classes/java/lang/foreign/Linker.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ static Option firstVariadicArg(int index) {
303303
* before it can be overwritten by the Java runtime, or read through conventional means}
304304
* <p>
305305
* A downcall method handle linked with this option will feature an additional {@link MemorySegment}
306-
* parameter directly following the target address parameter. This memory segment must be a
307-
* native segment into which the captured state is written.
306+
* parameter directly following the target address, and optional {@link SegmentAllocator} parameters.
307+
* This memory segment must be a native segment into which the captured state is written.
308308
*
309309
* @param capturedState the names of the values to save.
310310
* @see CaptureCallState#supported()
@@ -323,6 +323,10 @@ static CaptureCallState captureCallState(String... capturedState) {
323323
* <p>
324324
* Execution state is captured by a downcall method handle on invocation, by writing it
325325
* to a native segment provided by the user to the downcall method handle.
326+
* For this purpose, a downcall method handle linked with the {@link #captureCallState(String[])}
327+
* option will feature an additional {@link MemorySegment} parameter directly
328+
* following the target address, and optional {@link SegmentAllocator} parameters.
329+
* This parameter represents the native segment into which the captured state is written.
326330
* <p>
327331
* The native segment should have the layout {@linkplain CaptureCallState#layout associated}
328332
* with the particular {@code CaptureCallState} instance used to link the downcall handle.

0 commit comments

Comments
 (0)