/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is set to 0. * <p> * If {@code size} is 0, the method is allowed but not required to return the null pointer. * * @since 1.0 */ public static <T extends PointerBase> T calloc(UnsignedWord size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).calloc(size); }
/** * Frees unmanaged memory that was previously allocated using methods of this class. * * @since 1.0 */ public static void free(PointerBase ptr) { ImageSingletons.lookup(UnmanagedMemorySupport.class).free(ptr); } }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is undefined. * <p> * If {@code size} is 0, the method is allowed but not required to return the null pointer. * * @since 1.0 */ public static <T extends PointerBase> T malloc(UnsignedWord size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).malloc(size); }
/** * Changes the size of the provided unmanaged memory to {@code size} bytes of unmanaged memory. * If the new size is larger than the old size, the content of the additional memory is * undefined. * * If {@code size} is 0, the method is allowed but not required to return the null pointer. */ public static <T extends PointerBase> T realloc(T ptr, UnsignedWord size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).realloc(ptr, size); }
/** * Changes the size of the provided unmanaged memory to {@code size} bytes of unmanaged memory. * If the new size is larger than the old size, the content of the additional memory is * undefined. * <p> * If {@code size} is 0, the method is allowed but not required to return the null pointer. * * @since 1.0 */ public static <T extends PointerBase> T realloc(T ptr, UnsignedWord size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).realloc(ptr, size); }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is undefined. * * If {@code size} is 0, the method is allowed but not required to return the null pointer. */ public static <T extends PointerBase> T malloc(UnsignedWord size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).malloc(size); }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is set to 0. * * If {@code size} is 0, the method is allowed but not required to return the null pointer. */ public static <T extends PointerBase> T calloc(UnsignedWord size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).calloc(size); }
/** * Frees unmanaged memory that was previously allocated using methods of this class. */ public static void free(PointerBase ptr) { ImageSingletons.lookup(UnmanagedMemorySupport.class).free(ptr); } }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is undefined. * <p> * If {@code size} is 0, the method is allowed but not required to return the null pointer. * * @since 1.0 */ public static <T extends PointerBase> T malloc(int size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).malloc(WordFactory.unsigned(size)); }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is set to 0. * <p> * If {@code size} is 0, the method is allowed but not required to return the null pointer. * * @since 1.0 */ public static <T extends PointerBase> T calloc(int size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).calloc(WordFactory.unsigned(size)); }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is undefined. * * If {@code size} is 0, the method is allowed but not required to return the null pointer. */ public static <T extends PointerBase> T malloc(int size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).malloc(WordFactory.unsigned(size)); }
/** * Allocates {@code size} bytes of unmanaged memory. The content of the memory is set to 0. * * If {@code size} is 0, the method is allowed but not required to return the null pointer. */ public static <T extends PointerBase> T calloc(int size) { return ImageSingletons.lookup(UnmanagedMemorySupport.class).calloc(WordFactory.unsigned(size)); }