diff --git a/src/java.base/share/classes/java/lang/foreign/Linker.java b/src/java.base/share/classes/java/lang/foreign/Linker.java index 545a83984f8..fd6e820d016 100644 --- a/src/java.base/share/classes/java/lang/foreign/Linker.java +++ b/src/java.base/share/classes/java/lang/foreign/Linker.java @@ -222,7 +222,7 @@ import java.util.stream.Stream; *
  * MemoryLayout.structLayout(
  *     ValueLayout.JAVA_INT.withName("x"),
- *     MemoryLayout.paddingLayout(32),
+ *     MemoryLayout.paddingLayout(4),
  *     ValueLayout.JAVA_LONG.withName("y")
  * );
  * 
diff --git a/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java b/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java index 372b10aab13..989fc134a26 100644 --- a/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java +++ b/src/java.base/share/classes/java/lang/foreign/MemoryLayout.java @@ -369,7 +369,7 @@ import jdk.internal.foreign.layout.UnionLayoutImpl; * int size = ... * MemorySegment points = ... * for (int i = 0 ; i < size ; i++) { - * ... POINT_ARR_X.get(segment, 0L, (long)i) ... + * ... POINT_ARR_X.get(points, 0L, (long)i) ... * } * } *