Class MemoryUtilFFM

java.lang.Object
org.lwjgl.system.ffm.MemoryUtilFFM

@NullMarked public final class MemoryUtilFFM extends Object
Additional memory utilities for FFM.

This API is meant to be used with static import.

  • Method Details

    • memSet

      public static void memSet(MemorySegment ptr, int value)
      Sets all bytes in a specified block of memory to a fixed value (usually zero).
      Parameters:
      ptr - the starting memory address
      value - the value to set (memSet will convert it to unsigned byte)
    • memCopy

      public static void memCopy(MemorySegment src, MemorySegment dst)
      Sets all bytes in a specified block of memory to a copy of another block.
      Parameters:
      src - the source memory address
      dst - the destination memory address
    • memCopy

      public static void memCopy(byte[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(char[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(short[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(int[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(long[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(float[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(double[] src, MemorySegment dst)
      Copies the source array to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
    • memCopy

      public static void memCopy(byte[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(char[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(short[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(int[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(long[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(float[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(double[] src, MemorySegment dst, int offset, int size)
      Copies size elements from the source array, starting at offset, to the current position of the destination memory segment.
      Parameters:
      src - the source array
      dst - the destination memory segment
      offset - the offset into the source array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, byte[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, char[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, short[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, int[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, long[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, float[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, double[] dst)
      Copies the source memory segment to the destination array.
      Parameters:
      src - the source memory segment
      dst - the destination array
    • memCopy

      public static void memCopy(MemorySegment src, byte[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, char[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, short[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, int[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, long[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, float[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memCopy

      public static void memCopy(MemorySegment src, double[] dst, int offset, int size)
      Copies size elements from the source memory segment to the destination array, starting at offset.
      Parameters:
      src - the source memory segment
      dst - the destination array
      offset - the offset into the destination array
      size - the number of elements to copy
    • memGetBoolean

      public static boolean memGetBoolean(MemorySegment segment, long offset)
    • memGetByte

      public static byte memGetByte(MemorySegment segment, long offset)
    • memGetChar

      public static char memGetChar(MemorySegment segment, long offset)
    • memGetCharAtIndex

      public static char memGetCharAtIndex(MemorySegment segment, long index)
    • memGetCharUnaligned

      public static char memGetCharUnaligned(MemorySegment segment, long offset)
    • memGetCharUnalignedAtIndex

      public static char memGetCharUnalignedAtIndex(MemorySegment segment, long index)
    • memGetShort

      public static short memGetShort(MemorySegment segment, long offset)
    • memGetShortAtIndex

      public static short memGetShortAtIndex(MemorySegment segment, long index)
    • memGetShortUnaligned

      public static short memGetShortUnaligned(MemorySegment segment, long offset)
    • memGetShortUnalignedAtIndex

      public static short memGetShortUnalignedAtIndex(MemorySegment segment, long index)
    • memGetInt

      public static int memGetInt(MemorySegment segment, long offset)
    • memGetIntAtIndex

      public static int memGetIntAtIndex(MemorySegment segment, long index)
    • memGetIntUnaligned

      public static int memGetIntUnaligned(MemorySegment segment, long offset)
    • memGetIntUnalignedAtIndex

      public static int memGetIntUnalignedAtIndex(MemorySegment segment, long index)
    • memGetLong

      public static long memGetLong(MemorySegment segment, long offset)
    • memGetLongAtIndex

      public static long memGetLongAtIndex(MemorySegment segment, long index)
    • memGetLongUnaligned

      public static long memGetLongUnaligned(MemorySegment segment, long offset)
    • memGetLongUnalignedAtIndex

      public static long memGetLongUnalignedAtIndex(MemorySegment segment, long index)
    • memGetFloat

      public static float memGetFloat(MemorySegment segment, long offset)
    • memGetFloatAtIndex

      public static float memGetFloatAtIndex(MemorySegment segment, long index)
    • memGetFloatUnaligned

      public static float memGetFloatUnaligned(MemorySegment segment, long offset)
    • memGetFloatUnalignedAtIndex

      public static float memGetFloatUnalignedAtIndex(MemorySegment segment, long index)
    • memGetDouble

      public static double memGetDouble(MemorySegment segment, long offset)
    • memGetDoubleAtIndex

      public static double memGetDoubleAtIndex(MemorySegment segment, long index)
    • memGetDoubleUnaligned

      public static double memGetDoubleUnaligned(MemorySegment segment, long offset)
    • memGetDoubleUnalignedAtIndex

      public static double memGetDoubleUnalignedAtIndex(MemorySegment segment, long index)
    • memGetCLong

      public static long memGetCLong(MemorySegment segment, long offset)
    • memGetCLongAtIndex

      public static long memGetCLongAtIndex(MemorySegment segment, long index)
    • memGetCLongUnaligned

      public static long memGetCLongUnaligned(MemorySegment segment, long offset)
    • memGetCLongUnalignedAtIndex

      public static long memGetCLongUnalignedAtIndex(MemorySegment segment, long index)
    • memGetAddress

      public static long memGetAddress(MemorySegment segment, long offset)
    • memGetAddressAtIndex

      public static long memGetAddressAtIndex(MemorySegment segment, long index)
    • memGetAddressUnaligned

      public static long memGetAddressUnaligned(MemorySegment segment, long offset)
    • memGetAddressUnalignedAtIndex

      public static long memGetAddressUnalignedAtIndex(MemorySegment segment, long index)
    • memPutBoolean

      public static void memPutBoolean(MemorySegment segment, long offset, boolean value)
    • memPutByte

      public static void memPutByte(MemorySegment segment, long offset, byte value)
    • memPutChar

      public static void memPutChar(MemorySegment segment, long offset, char value)
    • memPutCharAtIndex

      public static void memPutCharAtIndex(MemorySegment segment, long index, char value)
    • memPutCharUnaligned

      public static void memPutCharUnaligned(MemorySegment segment, long offset, char value)
    • memPutCharUnalignedAtIndex

      public static void memPutCharUnalignedAtIndex(MemorySegment segment, long index, char value)
    • memPutShort

      public static void memPutShort(MemorySegment segment, long offset, short value)
    • memPutShortAtIndex

      public static void memPutShortAtIndex(MemorySegment segment, long index, short value)
    • memPutShortUnaligned

      public static void memPutShortUnaligned(MemorySegment segment, long offset, short value)
    • memPutShortUnalignedAtIndex

      public static void memPutShortUnalignedAtIndex(MemorySegment segment, long index, short value)
    • memPutInt

      public static void memPutInt(MemorySegment segment, long offset, int value)
    • memPutIntAtIndex

      public static void memPutIntAtIndex(MemorySegment segment, long index, int value)
    • memPutIntUnaligned

      public static void memPutIntUnaligned(MemorySegment segment, long offset, int value)
    • memPutIntUnalignedAtIndex

      public static void memPutIntUnalignedAtIndex(MemorySegment segment, long index, int value)
    • memPutLong

      public static void memPutLong(MemorySegment segment, long offset, long value)
    • memPutLongAtIndex

      public static void memPutLongAtIndex(MemorySegment segment, long index, long value)
    • memPutLongUnaligned

      public static void memPutLongUnaligned(MemorySegment segment, long offset, long value)
    • memPutLongUnalignedAtIndex

      public static void memPutLongUnalignedAtIndex(MemorySegment segment, long index, long value)
    • memPutFloat

      public static void memPutFloat(MemorySegment segment, long offset, float value)
    • memPutFloatAtIndex

      public static void memPutFloatAtIndex(MemorySegment segment, long index, float value)
    • memPutFloatUnaligned

      public static void memPutFloatUnaligned(MemorySegment segment, long offset, float value)
    • memPutFloatUnalignedAtIndex

      public static void memPutFloatUnalignedAtIndex(MemorySegment segment, long index, float value)
    • memPutDouble

      public static void memPutDouble(MemorySegment segment, long offset, double value)
    • memPutDoubleAtIndex

      public static void memPutDoubleAtIndex(MemorySegment segment, long index, double value)
    • memPutDoubleUnaligned

      public static void memPutDoubleUnaligned(MemorySegment segment, long offset, double value)
    • memPutDoubleUnalignedAtIndex

      public static void memPutDoubleUnalignedAtIndex(MemorySegment segment, long index, double value)
    • memPutCLong

      public static void memPutCLong(MemorySegment segment, long offset, long value)
    • memPutCLongAtIndex

      public static void memPutCLongAtIndex(MemorySegment segment, long index, long value)
    • memPutCLongUnaligned

      public static void memPutCLongUnaligned(MemorySegment segment, long offset, long value)
    • memPutCLongUnalignedAtIndex

      public static void memPutCLongUnalignedAtIndex(MemorySegment segment, long index, long value)
    • memPutAddress

      public static void memPutAddress(MemorySegment segment, long offset, long value)
    • memPutAddressAtIndex

      public static void memPutAddressAtIndex(MemorySegment segment, long index, long value)
    • memPutAddressUnaligned

      public static void memPutAddressUnaligned(MemorySegment segment, long offset, long value)
    • memPutAddressUnalignedAtIndex

      public static void memPutAddressUnalignedAtIndex(MemorySegment segment, long index, long value)