Uses of Class
jdk.incubator.foreign.ValueLayout
Package
Description
Classes to support low-level and efficient foreign memory/function access, directly from Java.
-
Uses of ValueLayout in jdk.incubator.foreign
Modifier and TypeFieldDescriptionstatic ValueLayout
MemoryLayouts.ADDRESS
A value layout constant whose size is the same as that of a machine address (e.g.static ValueLayout
MemoryLayouts.BITS_16_BE
A value layout constant with size of two bytes, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_16_LE
A value layout constant with size of two bytes, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_32_BE
A value layout constant with size of four bytes, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_32_LE
A value layout constant with size of four bytes, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_64_BE
A value layout constant with size of eight bytes, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_64_LE
A value layout constant with size of eight bytes, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_8_BE
A value layout constant with size of one byte, and byte order set toByteOrder.BIG_ENDIAN
.static ValueLayout
MemoryLayouts.BITS_8_LE
A value layout constant with size of one byte, and byte order set toByteOrder.LITTLE_ENDIAN
.static ValueLayout
CLinker.C_CHAR
The layout for thechar
C typestatic ValueLayout
CLinker.C_DOUBLE
The layout for thedouble
C typestatic ValueLayout
CLinker.C_FLOAT
The layout for thefloat
C typestatic ValueLayout
CLinker.C_INT
The layout for theint
C typestatic ValueLayout
CLinker.C_LONG
The layout for thelong
C typestatic ValueLayout
CLinker.C_LONG_LONG
The layout for thelong long
C type.static ValueLayout
CLinker.C_POINTER
TheT*
native type.static ValueLayout
CLinker.C_SHORT
The layout for theshort
C typestatic ValueLayout
MemoryLayouts.JAVA_BYTE
A value layout constant whose size is the same as that of a Javabyte
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
MemoryLayouts.JAVA_CHAR
A value layout constant whose size is the same as that of a Javachar
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
MemoryLayouts.JAVA_DOUBLE
A value layout constant whose size is the same as that of a Javadouble
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
MemoryLayouts.JAVA_FLOAT
A value layout constant whose size is the same as that of a Javafloat
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
MemoryLayouts.JAVA_INT
A value layout constant whose size is the same as that of a Javaint
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
MemoryLayouts.JAVA_LONG
A value layout constant whose size is the same as that of a Javalong
, and byte order set toByteOrder.nativeOrder()
.static ValueLayout
MemoryLayouts.JAVA_SHORT
A value layout constant whose size is the same as that of a Javashort
, and byte order set toByteOrder.nativeOrder()
.Modifier and TypeMethodDescriptionstatic ValueLayout
MemoryLayout.ofValueBits(long size, ByteOrder order)
Create a value layout of given byte order and size.ValueLayout.withAttribute(String name, Constable value)
Returns a new memory layout which features the same attributes as this layout, plus the newly specified attribute.ValueLayout.withBitAlignment(long alignmentBits)
Creates a new layout which features the desired alignment constraint.Creates a new layout which features the desired layout name.Returns a new value layout with given byte order.Modifier and TypeMethodDescriptiondefault MemorySegment
NativeScope.allocate(ValueLayout layout, byte value)
Allocate a block of memory in this native scope with given layout and initialize it with given byte value.default MemorySegment
NativeScope.allocate(ValueLayout layout, char value)
Allocate a block of memory in this native scope with given layout and initialize it with given char value.default MemorySegment
NativeScope.allocate(ValueLayout layout, double value)
Allocate a block of memory in this native scope with given layout and initialize it with given double value.default MemorySegment
NativeScope.allocate(ValueLayout layout, float value)
Allocate a block of memory in this native scope with given layout and initialize it with given float value.default MemorySegment
NativeScope.allocate(ValueLayout layout, int value)
Allocate a block of memory in this native scope with given layout and initialize it with given int value.default MemorySegment
NativeScope.allocate(ValueLayout layout, long value)
Allocate a block of memory in this native scope with given layout and initialize it with given long value.default MemorySegment
NativeScope.allocate(ValueLayout layout, short value)
Allocate a block of memory in this native scope with given layout and initialize it with given short value.default MemorySegment
NativeScope.allocate(ValueLayout layout, Addressable value)
Allocate a block of memory in this native scope with given layout and initialize it with given address value (expressed as anAddressable
instance).default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, byte[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given byte array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, char[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given char array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, double[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given double array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, float[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given float array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, int[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given int array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, long[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given long array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, short[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given short array.default MemorySegment
NativeScope.allocateArray(ValueLayout elementLayout, Addressable[] array)
Allocate a block of memory in this native scope with given layout and initialize it with given address array.CLinker.VaList.Builder.vargFromAddress(ValueLayout layout, Addressable value)
Adds a native value represented as aMemoryAddress
to the Cva_list
being constructed.CLinker.VaList.Builder.vargFromDouble(ValueLayout layout, double value)
Adds a native value represented as adouble
to the Cva_list
being constructed.CLinker.VaList.Builder.vargFromInt(ValueLayout layout, int value)
Adds a native value represented as anint
to the Cva_list
being constructed.CLinker.VaList.Builder.vargFromLong(ValueLayout layout, long value)
Adds a native value represented as along
to the Cva_list
being constructed.