public final class UnmanagedMemory extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends org.graalvm.word.PointerBase> |
calloc(int size)
Allocates
size bytes of unmanaged memory. |
static <T extends org.graalvm.word.PointerBase> |
calloc(org.graalvm.word.UnsignedWord size)
Allocates
size bytes of unmanaged memory. |
static void |
free(org.graalvm.word.PointerBase ptr)
Frees unmanaged memory that was previously allocated using methods of this class.
|
static <T extends org.graalvm.word.PointerBase> |
malloc(int size)
Allocates
size bytes of unmanaged memory. |
static <T extends org.graalvm.word.PointerBase> |
malloc(org.graalvm.word.UnsignedWord size)
Allocates
size bytes of unmanaged memory. |
static <T extends org.graalvm.word.PointerBase> |
realloc(T ptr,
org.graalvm.word.UnsignedWord size)
Changes the size of the provided unmanaged memory to
size bytes of unmanaged memory. |
public static <T extends org.graalvm.word.PointerBase> T malloc(org.graalvm.word.UnsignedWord size)
size bytes of unmanaged memory. The content of the memory is undefined.
If size is 0, the method is allowed but not required to return the null pointer. This
method never returns a the null pointer, but instead throws a OutOfMemoryError when
allocation fails.
public static <T extends org.graalvm.word.PointerBase> T malloc(int size)
size bytes of unmanaged memory. The content of the memory is undefined.
If size is 0, the method is allowed but not required to return the null pointer. This
method never returns a the null pointer, but instead throws a OutOfMemoryError when
allocation fails.
public static <T extends org.graalvm.word.PointerBase> T calloc(org.graalvm.word.UnsignedWord size)
size bytes of unmanaged memory. The content of the memory is set to 0.
If size is 0, the method is allowed but not required to return the null pointer. This
method never returns a the null pointer, but instead throws a OutOfMemoryError when
allocation fails.
public static <T extends org.graalvm.word.PointerBase> T calloc(int size)
size bytes of unmanaged memory. The content of the memory is set to 0.
If size is 0, the method is allowed but not required to return the null pointer. This
method never returns a the null pointer, but instead throws a OutOfMemoryError when
allocation fails.
public static <T extends org.graalvm.word.PointerBase> T realloc(T ptr,
org.graalvm.word.UnsignedWord size)
size bytes of unmanaged memory.
If the new size is larger than the old size, the content of the additional memory is
undefined.
If size is 0, the method is allowed but not required to return the null pointer. This
method never returns a the null pointer, but instead throws a OutOfMemoryError when
allocation fails.
public static void free(org.graalvm.word.PointerBase ptr)