接口的使用
java.lang.foreign.MemoryLayout
使用 MemoryLayout 的包PREVIEW
-
MemoryLayout 的用法PREVIEW 在java.lang.foreign
修饰符和类型接口描述interface预览。聚合多个 member layouts 的复合布局。interface预览。填充布局。interface预览。表示给定 element layout 重复的复合布局。interface预览。一个组布局,其成员布局一个接一个地布置。interface预览。一种组布局,其成员布局以相同的起始偏移量布置。interface预览。对基本数据类型的值建模的布局。static interface预览。载体为MemorySegment.class的值布局。static interface预览。载体为boolean.class的值布局。static interface预览。载体为byte.class的值布局。static interface预览。载体为char.class的值布局。static interface预览。载体为double.class的值布局。static interface预览。载体为float.class的值布局。static interface预览。载体为int.class的值布局。static interface预览。载体为long.class的值布局。static interface预览。载体为short.class的值布局。java.lang.foreign 中返回 MemoryLayout 的方法PREVIEW修饰符和类型方法描述SequenceLayout.elementLayout()返回与此序列布局关联的元素布局。default MemoryLayoutPREVIEWMemoryLayout.select(MemoryLayout.PathElementPREVIEW... elements) 从以该布局为根的路径中选择布局。MemoryLayout.withBitAlignment(long bitAlignment) 返回与此布局具有相同大小和名称但具有指定对齐约束(以位为单位)的相同类型的内存布局。返回与此布局具有相同大小和对齐约束但具有指定名称的相同类型的内存布局。返回类型中包含 MemoryLayout 类型参数的 java.lang.foreign 中的方法PREVIEW修饰符和类型方法描述FunctionDescriptor.argumentLayouts()返回与此函数描述符关联的参数布局(作为不可变列表)。GroupLayout.memberLayouts()返回与该组关联的成员布局。FunctionDescriptor.returnLayout()返回与此函数描述符关联的返回布局(如果有)。java.lang.foreign 中的方法,参数类型为 MemoryLayoutPREVIEW修饰符和类型方法描述default MemorySegmentPREVIEWSegmentAllocator.allocate(MemoryLayoutPREVIEW layout) 分配具有给定布局的内存段。default MemorySegmentPREVIEWSegmentAllocator.allocateArray(MemoryLayoutPREVIEW elementLayout, long count) 分配具有给定元素布局和大小的内存段。static MemorySegmentPREVIEWMemorySegment.allocateNative(MemoryLayoutPREVIEW layout, SegmentScopePREVIEW scope) 创建具有给定布局和范围的本机段。FunctionDescriptor.appendArgumentLayouts(MemoryLayoutPREVIEW... addedLayouts) 返回一个函数描述符,其中给定的参数布局附加到此函数描述符的参数布局数组。FunctionDescriptor.changeReturnLayout(MemoryLayoutPREVIEW newReturn) 返回具有给定内存布局的函数描述符作为新的返回布局。MemorySegment.elements(MemoryLayoutPREVIEW elementLayout) 返回此段中不相交切片(其大小与指定布局的大小匹配)的顺序Stream。FunctionDescriptor.insertArgumentLayouts(int index, MemoryLayoutPREVIEW... addedLayouts) 将给定参数布局插入到给定索引处的函数描述符返回到此函数描述符的参数布局数组中。static FunctionDescriptorPREVIEWFunctionDescriptor.of(MemoryLayoutPREVIEW resLayout, MemoryLayoutPREVIEW... argLayouts) 使用给定的返回和参数布局创建函数描述符。static FunctionDescriptorPREVIEWFunctionDescriptor.ofVoid(MemoryLayoutPREVIEW... argLayouts) 创建具有给定参数布局且无返回布局的函数描述符。static SequenceLayoutPREVIEWMemoryLayout.sequenceLayout(long elementCount, MemoryLayoutPREVIEW elementLayout) 使用给定的元素布局和元素计数创建序列布局。static SequenceLayoutPREVIEWMemoryLayout.sequenceLayout(MemoryLayoutPREVIEW elementLayout) 使用给定的元素布局和最大元素数创建序列布局,使其不会溢出long。voidVaList.skip(MemoryLayoutPREVIEW... layouts) 跳过具有给定内存布局的多个元素,并推进此可变参数列表的位置。MemorySegment.spliterator(MemoryLayoutPREVIEW elementLayout) 返回此内存段的拆分器。static StructLayoutPREVIEWMemoryLayout.structLayout(MemoryLayoutPREVIEW... elements) 使用给定的成员布局创建结构布局。static UnionLayoutPREVIEWMemoryLayout.unionLayout(MemoryLayoutPREVIEW... elements) 使用给定的成员布局创建联合布局。