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 MemorySegment
MemorySegment. acquire()
Obtains an acquired memory segment which can be used to access memory associated with this segment from the current thread.static MemorySegment
MemorySegment. 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 MemorySegment
MemorySegment. 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 MemorySegment
MemorySegment. allocateNative(MemoryLayout layout)
Creates a new native memory segment that models a newly allocated block of off-heap memory with given layout.MemorySegment
MemorySegment. asReadOnly()
Obtains a read-only view of this segment.MemorySegment
MemorySegment. 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 MemorySegment
MemorySegment. 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 MemorySegment
MemorySegment. ofArray(byte[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated byte array.static MemorySegment
MemorySegment. ofArray(char[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated char array.static MemorySegment
MemorySegment. ofArray(double[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated double array.static MemorySegment
MemorySegment. ofArray(float[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated float array.static MemorySegment
MemorySegment. ofArray(int[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated int array.static MemorySegment
MemorySegment. ofArray(long[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated long array.static MemorySegment
MemorySegment. ofArray(short[] arr)
Creates a new array memory segment that models the memory associated with a given heap-allocated short array.static MemorySegment
MemorySegment. ofByteBuffer(ByteBuffer bb)
Creates a new buffer memory segment that models the memory associated with the given byte buffer.MemorySegment
MemoryAddress. segment()
The memory segment this address belongs to.