Interface VkReallocationFunctionI
-
- All Superinterfaces:
- CallbackI, CallbackI.P, Pointer
- All Known Implementing Classes:
- VkReallocationFunction
@FunctionalInterface public interface VkReallocationFunctionI extends CallbackI.P
Instances of this interface may be set to thepfnReallocation
member of theVkAllocationCallbacks
struct.The function must alter the size of the allocation
pOriginal
, either by shrinking or growing it, to accommodate the new size.If
pOriginal
isNULL
, thenpfnReallocation
must behave similarly toVkAllocationFunction
. If size is zero, thenpfnReallocation
must behave similarly toVkFreeFunction
. The contents of the original allocation from bytes zero tomin(original size, new size) − 1
must be preserved in the new allocation. If the new allocation is larger than the old allocation, then the contents of the additional space are undefined. IfpOriginal
is non-NULL
, alignment must be equal to the originally requested alignment. If satisfying these requirements involves creating a new allocation, then the old allocation must be freed. If this function fails, it must returnNULL
and not free the old allocation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.lwjgl.system.CallbackI
CallbackI.B, CallbackI.D, CallbackI.F, CallbackI.I, CallbackI.J, CallbackI.P, CallbackI.S, CallbackI.V, CallbackI.Z
-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method and Description default long
address()
Returns the raw pointer address as along
value.default long
callback(long args)
Will be called by native code.long
invoke(long pUserData, long pOriginal, long size, long alignment, int allocationScope)
Will be called by the Vulkan implementation to reallocate memory.
-
-
-
Method Detail
-
address
default long address()
Description copied from interface:Pointer
Returns the raw pointer address as along
value.
-
callback
default long callback(long args)
Description copied from interface:CallbackI.P
Will be called by native code.- Specified by:
callback
in interfaceCallbackI.P
- Parameters:
args
- pointer to aDCArgs
iterator- Returns:
- the value to store to the result
DCValue
-
invoke
long invoke(long pUserData, long pOriginal, long size, long alignment, int allocationScope)
Will be called by the Vulkan implementation to reallocate memory.- Parameters:
pUserData
- the value specified forVkAllocationCallbacks
.pUserData
in the allocator specified by the applicationpOriginal
- must be eitherNULL
or a pointer previously returned bypfnReallocation
orpfnAllocation
of the same allocatorsize
- the size in bytes of the requested allocationalignment
- the requested alignment of the allocation in bytes and must be a power of twoallocationScope
- aVkSystemAllocationScope
value specifying the scope of the lifetime of the allocation
-
-