Class VkAllocationCallbacks

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer


    public class VkAllocationCallbacks
    extends Struct
    Khronos Reference Page
    Vulkan Specification

    Contains pointers to callback functions that are used to create, reallocate and free host memory allocations on behalf of a Vulkan implementation.

    Valid Usage
    • pfnAllocation must be a pointer to a valid user-defined PFN_vkAllocationFunction
    • pfnReallocation must be a pointer to a valid user-defined PFN_vkReallocationFunction
    • pfnFree must be a pointer to a valid user-defined PFN_vkFreeFunction
    • If either of pfnInternalAllocation or pfnInternalFree is not NULL, both must be valid callbacks

    Member documentation

    • pUserData – a value to be interpreted by the implementation of the callbacks. When any of the callbacks in VkAllocationCallbacks are called, the Vulkan implementation will pass this value as the first parameter to the callback. This value can vary each time an allocator is passed into a command, even when the same object takes an allocator in multiple commands.
    • pfnAllocation – a pointer to an application-defined memory allocation function of type PFN_vkAllocationFunction
    • pfnReallocation – a pointer to an application-defined memory reallocation function of type PFN_vkReallocationFunction
    • pfnFree – a pointer to an application-defined memory free function of type PFN_vkFreeFunction
    • pfnInternalAllocation – a pointer to an application-defined function that is called by the implementation when the implementation makes internal allocations, and it is of type PFN_vkInternalAllocationNotification
    • pfnInternalFree – a pointer to an application-defined function that is called by the implementation when the implementation frees internal allocations, and it is of type PFN_vkInternalFreeNotification

    Layout

    struct VkAllocationCallbacks {
        void * pUserData;
        PFN_vkAllocationFunction pfnAllocation;
        PFN_vkReallocationFunction pfnReallocation;
        PFN_vkFreeFunction pfnFree;
        PFN_vkInternalAllocationNotification pfnInternalAllocation;
        PFN_vkInternalFreeNotification pfnInternalFree;
    }