/** * Allocates {@code size} bytes and returns a pointer to the allocated memory. The memory is not initialized. If {@code size} is 0, then malloc() returns * either {@code NULL}, or a unique pointer value that can later be successfully passed to {@link #free}. * * @param size the number of bytes to allocate */ @Nullable @NativeType("void *") public static ByteBuffer malloc(@NativeType("size_t") long size) { long __result = nmalloc(size); return memByteBufferSafe(__result, (int)size); }
/** * Allocates {@code size} bytes of uninitialized memory. The allocated space is suitably aligned (after possible pointer coercion) for storage of any type * of object. * * @param size the number of bytes to allocate */ @Nullable @NativeType("void *") public static ByteBuffer je_malloc(@NativeType("size_t") long size) { long __result = nje_malloc(size); return memByteBufferSafe(__result, (int)size); }
/** Allocates a memory block of at least the given size. */ @Nullable @NativeType("void *") public static ByteBuffer rpmalloc(@NativeType("size_t") long size) { long __result = nrpmalloc(size); return memByteBufferSafe(__result, (int)size); }
/** Reallocates the given block to at least the given size. */ @Nullable @NativeType("void *") public static ByteBuffer rprealloc(@Nullable @NativeType("void *") ByteBuffer ptr, @NativeType("size_t") long size) { long __result = nrprealloc(memAddressSafe(ptr), size); return memByteBufferSafe(__result, (int)size); }
/** * Allocates space for {@code num} objects, each {@code size} bytes in length. The result is identical to calling {@link #je_malloc malloc} with an argument of * {@code num * size}, with the exception that the allocated memory is explicitly initialized to zero bytes. * * @param num the number of objects to allocate * @param size the size of each object, in bytes */ @Nullable @NativeType("void *") public static ByteBuffer je_calloc(@NativeType("size_t") long num, @NativeType("size_t") long size) { long __result = nje_calloc(num, size); return memByteBufferSafe(__result, (int)num * (int)size); }
/** Allocates a memory block of at least the given size and alignment. */ @Nullable @NativeType("void *") public static ByteBuffer rpmemalign(@NativeType("size_t") long alignment, @NativeType("size_t") long size) { long __result = nrpmemalign(alignment, size); return memByteBufferSafe(__result, (int)size); }
/** Allocates a memory block of at least the given size and zero initializes it. */ @Nullable @NativeType("void *") public static ByteBuffer rpcalloc(@NativeType("size_t") long num, @NativeType("size_t") long size) { long __result = nrpcalloc(num, size); return memByteBufferSafe(__result, (int)num * (int)size); }
/** Allocates a memory block of at least the given size and alignment. */ @Nullable @NativeType("void *") public static ByteBuffer rpaligned_alloc(@NativeType("size_t") long alignment, @NativeType("size_t") long size) { long __result = nrpaligned_alloc(alignment, size); return memByteBufferSafe(__result, (int)size); }
/** * Allocates {@code size} bytes of memory such that the allocation's base address is an even multiple of {@code alignment}. The requested alignment must * be a power of 2. Behavior is undefined if {@code size} is not an integral multiple of {@code alignment}. * * @param alignment the allocation alignment, in bytes * @param size the number of bytes to allocate */ @Nullable @NativeType("void *") public static ByteBuffer je_aligned_alloc(@NativeType("size_t") long alignment, @NativeType("size_t") long size) { long __result = nje_aligned_alloc(alignment, size); return memByteBufferSafe(__result, (int)size); }
@Nullable @NativeType("void *") public static ByteBuffer glMapBufferOES(@NativeType("GLenum") int target, @NativeType("GLenum") int access) { long __result = nglMapBufferOES(target, access); return memByteBufferSafe(__result, GLES20.glGetBufferParameteri(target, GLES20.GL_BUFFER_SIZE)); }
@Nullable @NativeType("void *") public static ByteBuffer glMapNamedBufferEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access) { long __result = nglMapNamedBufferEXT(buffer, access); return memByteBufferSafe(__result, glGetNamedBufferParameteriEXT(buffer, GL15.GL_BUFFER_SIZE)); }
@Nullable @NativeType("void *") public static ByteBuffer wglAllocateMemoryNV(@NativeType("GLsizei") int size, @NativeType("GLfloat") float readfreq, @NativeType("GLfloat") float writefreq, @NativeType("GLfloat") float priority) { long __result = nwglAllocateMemoryNV(size, readfreq, writefreq, priority); return memByteBufferSafe(__result, size); }
@Nullable @NativeType("void *") public static ByteBuffer glMapNamedBufferRangeEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { long __result = nglMapNamedBufferRangeEXT(buffer, offset, length, access); return memByteBufferSafe(__result, (int)length); }
/** <a target="_blank" href="http://docs.gl/es3/glMapBufferRange">Reference Page</a> */ @Nullable @NativeType("void *") public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { long __result = nglMapBufferRange(target, offset, length, access); return memByteBufferSafe(__result, (int)length); }
@Nullable @NativeType("void *") public static ByteBuffer glMapBufferRangeEXT(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { long __result = nglMapBufferRangeEXT(target, offset, length, access); return memByteBufferSafe(__result, (int)length); }
/** ZLIB client - used by PNG, available for other purposes */ @Nullable @NativeType("char *") public static ByteBuffer stbi_zlib_decode_noheader_malloc(@NativeType("char const *") ByteBuffer buffer) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { IntBuffer outlen = stack.callocInt(1); long __result = nstbi_zlib_decode_noheader_malloc(memAddress(buffer), buffer.remaining(), memAddress(outlen)); return memByteBufferSafe(__result, outlen.get(0)); } finally { stack.setPointer(stackPointer); } }
/** Reallocates the given block to at least the given size and alignment, with optional control flags (see {@link #RPMALLOC_NO_PRESERVE MALLOC_NO_PRESERVE}) */ @Nullable @NativeType("void *") public static ByteBuffer rpaligned_realloc(@Nullable @NativeType("void *") ByteBuffer ptr, @NativeType("size_t") long alignment, @NativeType("size_t") long size, @NativeType("unsigned int") int flags) { long __result = nrpaligned_realloc(memAddressSafe(ptr), alignment, size, remainingSafe(ptr), flags); return memByteBufferSafe(__result, (int)size); }
/** Array version of: {@link #stbtt_GetCodepointBitmap GetCodepointBitmap} */ @Nullable @NativeType("unsigned char *") public static ByteBuffer stbtt_GetCodepointBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, int codepoint, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] xoff, @Nullable @NativeType("int *") int[] yoff) { if (CHECKS) { check(width, 1); check(height, 1); checkSafe(xoff, 1); checkSafe(yoff, 1); } long __result = nstbtt_GetCodepointBitmap(info.address(), scale_x, scale_y, codepoint, width, height, xoff, yoff); return memByteBufferSafe(__result, width[0] * height[0]); }
/** Array version of: {@link #stbi_load_from_memory load_from_memory} */ @Nullable @NativeType("stbi_uc *") public static ByteBuffer stbi_load_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { if (CHECKS) { check(x, 1); check(y, 1); check(channels_in_file, 1); } long __result = nstbi_load_from_memory(memAddress(buffer), buffer.remaining(), x, y, channels_in_file, desired_channels); return memByteBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); }
/** Array version of: {@link #stbtt_GetCodepointSDF GetCodepointSDF} */ @Nullable @NativeType("unsigned char *") public static ByteBuffer stbtt_GetCodepointSDF(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, float scale, int codepoint, int padding, @NativeType("unsigned char") byte onedge_value, float pixel_dist_scale, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @NativeType("int *") int[] xoff, @NativeType("int *") int[] yoff) { if (CHECKS) { check(width, 1); check(height, 1); check(xoff, 1); check(yoff, 1); } long __result = nstbtt_GetCodepointSDF(font.address(), scale, codepoint, padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); return memByteBufferSafe(__result, width[0] * height[0]); }