Top Description Inners Constructors Methods
org.lwjgl.glfw

public abstract Class GLFWReallocateCallback

extends Callback
implements GLFWReallocateCallbackI
Class Inheritance
All Implemented Interfaces
org.lwjgl.glfw.GLFWReallocateCallbackI, org.lwjgl.system.CallbackI, org.lwjgl.system.Pointer
Known Direct Subclasses
org.lwjgl.glfw.GLFWReallocateCallback.Container
Imports
javax.annotation.*, org.lwjgl.system.*

The 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 size bytes long, or NULL 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 during Terminate after 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 NULL and the size will always be greater than zero. Reallocations of a block to size zero are converted into deallocations. Reallocations of NULL to a non-zero size are converted into regular allocations.

Note

Type


void * (*invoke) (
    void *block,
    size_t size,
    void *user
)
Since
version 3.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
protected
pack-priv
GLFWReallocateCallback(long functionPointer)

Method Summary

Modifier and TypeMethod and Description
public static GLFWReallocateCallback

Returns:

the new GLFWReallocateCallback
create
(long functionPointer)

Creates a GLFWReallocateCallback instance from the specified function pointer.

public static GLFWReallocateCallback
create(GLFWReallocateCallbackI instance)

Creates a GLFWReallocateCallback instance that delegates to the specified GLFWReallocateCallbackI instance.

public static GLFWReallocateCallback
createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Inherited from org.lwjgl.system.Callback:
addressequalsfreefreegetgetSafehashCodetoString

Constructor Detail

GLFWReallocateCallbackback to summary
protected GLFWReallocateCallback()
GLFWReallocateCallbackback to summary
pack-priv GLFWReallocateCallback(long functionPointer)

Method Detail

createback to summary
public static GLFWReallocateCallback create(long functionPointer)

Creates a GLFWReallocateCallback instance from the specified function pointer.

Returns:GLFWReallocateCallback

the new GLFWReallocateCallback

createback to summary
public static GLFWReallocateCallback create(GLFWReallocateCallbackI instance)

Creates a GLFWReallocateCallback instance that delegates to the specified GLFWReallocateCallbackI instance.

createSafeback to summary
public static GLFWReallocateCallback createSafe(long functionPointer)

Like create, but returns null if functionPointer is NULL.

Annotations
@Nullable
org.lwjgl.glfw back to summary

private final Class GLFWReallocateCallback.Container

extends GLFWReallocateCallback
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final GLFWReallocateCallbackI

Constructor Summary

AccessConstructor and Description
pack-priv
Container(long functionPointer, GLFWReallocateCallbackI delegate)

Method Summary

Modifier and TypeMethod and Description
public long
invoke(long
the address of the memory block to reallocate
block
,
long
the new minimum size, in bytes, of the memory block
size
,
long
the user-defined pointer from the allocator
user
)

Implements org.lwjgl.glfw.GLFWReallocateCallbackI.invoke.

Will be called for memory reallocation requests.
Inherited from org.lwjgl.glfw.GLFWReallocateCallback:
createcreatecreateSafe

Field Detail

delegateback to summary
private final GLFWReallocateCallbackI delegate

Constructor Detail

Containerback to summary
pack-priv Container(long functionPointer, GLFWReallocateCallbackI delegate)

Method Detail

invokeback to summary
public long invoke(long block, long size, long user)

Implements org.lwjgl.glfw.GLFWReallocateCallbackI.invoke.

Doc from org.lwjgl.glfw.GLFWReallocateCallbackI.invoke.

Will be called for memory reallocation requests.

Parameters
block:long

the address of the memory block to reallocate

size:long

the new minimum size, in bytes, of the memory block

user:long

the user-defined pointer from the allocator

Returns:long

the address of the newly allocated or resized memory block, or NULL if an error occurred

Annotations
@Override