Uses of Interface
jdk.incubator.foreign.MemorySegment
| Package | Description |
|---|---|
| jdk.incubator.foreign |
Classes to support low-level, safe and efficient memory access.
|
-
Uses of MemorySegment in jdk.incubator.foreign
Methods in jdk.incubator.foreign that return MemorySegment Modifier and Type Method Description MemorySegmentMemorySegment. acquire()Obtains an acquired memory segment which can be used to access memory associated with this segment from the current thread.static MemorySegmentMemorySegment. allocateNative(long bytesSize)Creates a new native memory segment that models a newly allocated block of off-heap memory with given size (in bytes).static MemorySegmentMemorySegment. allocateNative(long bytesSize, long alignmentBytes)Creates a new native memory segment that models a newly allocated block of off-heap memory with given size and alignment constraint (in bytes).static MemorySegmentMemorySegment. allocateNative(MemoryLayout layout)Creates a new native memory segment that models a newly allocated block of off-heap memory with given layout.MemorySegmentMemorySegment. asReadOnly()Obtains a read-only view of this segment.MemorySegmentMemorySegment. asSlice(long offset, long newSize)Obtains a new memory segment view whose base address is the same as the base address of this segment plus a given offset, and whose new size is specified by the given argument.static MemorySegmentMemorySegment. mapFromPath(Path path, long bytesSize, FileChannel.MapMode mapMode)Creates a new mapped memory segment that models a memory-mapped region of a file from a given path.static MemorySegmentMemorySegment. ofArray(byte[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated byte array.static MemorySegmentMemorySegment. ofArray(char[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated char array.static MemorySegmentMemorySegment. ofArray(double[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated double array.static MemorySegmentMemorySegment. ofArray(float[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated float array.static MemorySegmentMemorySegment. ofArray(int[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated int array.static MemorySegmentMemorySegment. ofArray(long[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated long array.static MemorySegmentMemorySegment. ofArray(short[] arr)Creates a new array memory segment that models the memory associated with a given heap-allocated short array.static MemorySegmentMemorySegment. ofByteBuffer(ByteBuffer bb)Creates a new buffer memory segment that models the memory associated with the given byte buffer.MemorySegmentMemoryAddress. segment()The memory segment this address belongs to.