Class GLFWReallocateCallback
- All Implemented Interfaces:
AutoCloseable,GLFWReallocateCallbackI,org.lwjgl.system.CallbackI,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
This is the function pointer type for memory reallocation callbacks. A memory reallocation callback function has the following signature:
void* function_name(void* block, size_t size, void* user)
This function must return a memory block at least size bytes long, or NULL if allocation failed. Note that not all parts of GLFW handle
allocation failures gracefully yet.
This function must support being called during Init but before the library is flagged as initialized, as well as during Terminate after the
library is no longer flagged as initialized.
Any memory allocated via this function will be deallocated via the same allocator during library termination or earlier.
Any memory allocated via this function must be suitably aligned for any object type. If you are using C99 or earlier, this alignment is
platform-dependent but will be the same as what malloc provides. If you are using C11 or later, this is the value of
alignof(max_align_t).
The block address will never be NULL and the size will always be greater than zero. Reallocations of a block to size zero are converted into
deallocations before reaching the custom allocator. Reallocations of NULL to a non-zero size are converted into regular allocations before
reaching the custom allocator.
If this function returns NULL, GLFW will emit OUT_OF_MEMORY.
Note
- The returned memory block must be valid at least until it is deallocated.
- This function should not call any GLFW function.
- This function must support being called from any thread that calls GLFW functions.
Type
void * (*GLFWReallocateCallbackI.invoke(long, long, long)) (
void *block,
size_t size,
void *user
)- Since:
- version 3.4
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
Fields inherited from interface org.lwjgl.glfw.GLFWReallocateCallbackI
CIFFields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Method Summary
Modifier and TypeMethodDescriptionstatic GLFWReallocateCallbackcreate(long functionPointer) Creates aGLFWReallocateCallbackinstance from the specified function pointer.static GLFWReallocateCallbackcreate(GLFWReallocateCallbackI instance) Creates aGLFWReallocateCallbackinstance that delegates to the specifiedGLFWReallocateCallbackIinstance.static @Nullable GLFWReallocateCallbackcreateSafe(long functionPointer) Methods inherited from class org.lwjgl.system.Callback
address, equals, free, free, get, getSafe, hashCode, toStringMethods inherited from interface org.lwjgl.system.CallbackI
addressMethods inherited from interface org.lwjgl.glfw.GLFWReallocateCallbackI
callback, getCallInterface, invokeMethods inherited from interface org.lwjgl.system.NativeResource
close
-
Method Details
-
create
Creates aGLFWReallocateCallbackinstance from the specified function pointer.- Returns:
- the new
GLFWReallocateCallback
-
createSafe
-
create
Creates aGLFWReallocateCallbackinstance that delegates to the specifiedGLFWReallocateCallbackIinstance.
-