Package org.lwjgl.glfw
Class GLFWAllocateCallback
- java.lang.Object
-
- org.lwjgl.system.Callback
-
- org.lwjgl.glfw.GLFWAllocateCallback
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,GLFWAllocateCallbackI
,org.lwjgl.system.CallbackI
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public abstract class GLFWAllocateCallback extends org.lwjgl.system.Callback implements GLFWAllocateCallbackI
The function pointer type for memory allocation callbacks.This is the function pointer type for memory allocation callbacks. A memory allocation callback function has the following signature:
void* function_name(size_t size, void* user)
This function must return either a memory block at least
size
bytes long, orNULL
if allocation failed. Note that not all parts of GLFW handle allocation failures gracefully yet.This function may be called during
Init
but before the library is flagged as initialized, as well as duringTerminate
after the library is no longer flagged as initialized.Any memory allocated by this function will be deallocated during library termination or earlier.
The size will always be greater than zero. Allocations of size zero are filtered out before reaching the custom allocator.
Note
- The returned memory block must be valid at least until it is deallocated.
- This function should not call any GLFW function.
- This function may be called from any thread that calls GLFW functions.
Type
void * (*
GLFWAllocateCallbackI.invoke(long, long)
) ( size_t size, void *user )- Since:
- version 3.4
-
-
Field Summary
-
Fields inherited from interface org.lwjgl.glfw.GLFWAllocateCallbackI
CIF
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GLFWAllocateCallback
create(long functionPointer)
Creates aGLFWAllocateCallback
instance from the specified function pointer.static GLFWAllocateCallback
create(GLFWAllocateCallbackI instance)
Creates aGLFWAllocateCallback
instance that delegates to the specifiedGLFWAllocateCallbackI
instance.static GLFWAllocateCallback
createSafe(long functionPointer)
-
Methods inherited from class org.lwjgl.system.Callback
address, equals, free, free, get, getSafe, hashCode, toString
-
Methods inherited from interface org.lwjgl.glfw.GLFWAllocateCallbackI
callback, getCallInterface, invoke
-
-
-
-
Method Detail
-
create
public static GLFWAllocateCallback create(long functionPointer)
Creates aGLFWAllocateCallback
instance from the specified function pointer.- Returns:
- the new
GLFWAllocateCallback
-
createSafe
@Nullable public static GLFWAllocateCallback createSafe(long functionPointer)
-
create
public static GLFWAllocateCallback create(GLFWAllocateCallbackI instance)
Creates aGLFWAllocateCallback
instance that delegates to the specifiedGLFWAllocateCallbackI
instance.
-
-