Interface GLFWReallocateCallbackI
-
- All Superinterfaces:
org.lwjgl.system.CallbackI,org.lwjgl.system.Pointer
- All Known Implementing Classes:
GLFWReallocateCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface GLFWReallocateCallbackI extends org.lwjgl.system.CallbackIThe function pointer type for memory reallocation callbacks.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
sizebytes long, orNULLif allocation failed. Note that not all parts of GLFW handle allocation failures gracefully yet.This function may be called during
Initbut before the library is flagged as initialized, as well as duringTerminateafter the library is no longer flagged as initialized.Any memory allocated by this function will be deallocated during library termination or earlier.
The block address will never be
NULLand the size will always be greater than zero. Reallocations of a block to size zero are converted into deallocations. Reallocations ofNULLto a non-zero size are converted into regular allocations.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 * (*invoke(long, long, long)) ( void *block, size_t size, void *user )- Since:
- version 3.4
-
-
Field Summary
Fields Modifier and Type Field Description static org.lwjgl.system.libffi.FFICIFCIF
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidcallback(long ret, long args)default org.lwjgl.system.libffi.FFICIFgetCallInterface()longinvoke(long block, long size, long user)Will be called for memory reallocation requests.
-
-
-
Method Detail
-
getCallInterface
default org.lwjgl.system.libffi.FFICIF getCallInterface()
- Specified by:
getCallInterfacein interfaceorg.lwjgl.system.CallbackI
-
callback
default void callback(long ret, long args)- Specified by:
callbackin interfaceorg.lwjgl.system.CallbackI
-
invoke
long invoke(long block, long size, long user)Will be called for memory reallocation requests.- Parameters:
block- the address of the memory block to reallocatesize- the new minimum size, in bytes, of the memory blockuser- the user-defined pointer from the allocator- Returns:
- the address of the newly allocated or resized memory block, or
NULLif an error occurred
-
-