Class UnmanagedMemory


  • public final class UnmanagedMemory
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void free​(org.graalvm.word.PointerBase ptr)
      Frees unmanaged memory that was previously allocated using methods of this class.
      static org.graalvm.nativeimage.c.type.CDoublePointer mallocCDoublePointer​(long size)
      Allocates an double array of size in the unmanaged memory.
      static org.graalvm.nativeimage.c.type.CIntPointer mallocCIntPointer​(long size)
      Allocates an int array of size in the unmanaged memory.
      static org.graalvm.nativeimage.c.type.CDoublePointer reallocCDoublePointer​(org.graalvm.nativeimage.c.type.CDoublePointer ptr, long size)
      Changes the size of the provided double array in the unmanaged memory to size.
      static org.graalvm.nativeimage.c.type.CIntPointer reallocCIntPointer​(org.graalvm.nativeimage.c.type.CIntPointer ptr, long size)
      Changes the size of the provided int array in the unmanaged memory to size.
    • Method Detail

      • mallocCIntPointer

        public static org.graalvm.nativeimage.c.type.CIntPointer mallocCIntPointer​(long size)
        Allocates an int array of size in the unmanaged memory. The content of the memory is undefined. If size is 0, the method returns the null pointer.

        This class wraps around GraalVM infrastructure in order to fix quirky behaviour and provide an emulation on other JVMs.

      • mallocCDoublePointer

        public static org.graalvm.nativeimage.c.type.CDoublePointer mallocCDoublePointer​(long size)
        Allocates an double array of size in the unmanaged memory. The content of the memory is undefined. If size is 0, the method returns the null pointer.

        This class wraps around GraalVM infrastructure in order to fix quirky behaviour and provide an emulation on other JVMs.

      • reallocCIntPointer

        public static org.graalvm.nativeimage.c.type.CIntPointer reallocCIntPointer​(org.graalvm.nativeimage.c.type.CIntPointer ptr,
                                                                                    long size)
        Changes the size of the provided int array in the unmanaged memory to size. If the new size is larger than the old size, the content of the additional memory is undefined. If size is 0, the method returns the null pointer.

        This class wraps around GraalVM infrastructure in order to fix quirky behaviour and provide an emulation on other JVMs.

      • reallocCDoublePointer

        public static org.graalvm.nativeimage.c.type.CDoublePointer reallocCDoublePointer​(org.graalvm.nativeimage.c.type.CDoublePointer ptr,
                                                                                          long size)
        Changes the size of the provided double array in the unmanaged memory to size. If the new size is larger than the old size, the content of the additional memory is undefined. If size is 0, the method returns the null pointer.

        This class wraps around GraalVM infrastructure in order to fix quirky behaviour and provide an emulation on other JVMs.

      • free

        public static void free​(org.graalvm.word.PointerBase ptr)
        Frees unmanaged memory that was previously allocated using methods of this class.

        This class wraps around GraalVM infrastructure in order to fix quirky behaviour and provide an emulation on other JVMs.