VKALLOCATIONCALLBACK(3)

NAME
VkAllocationCallbacks - Structure containing callback function pointers for memory allocation.

C SPECIFICATION

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

FIELDS

pUserData
    A pointer-sized variable that the sole use of the application.

pfnAllocation
    A pointer to a function that is called to allocate host memory.

pfnReallocation
    A pointer to a function that is called to resize an existing host memory allocation.

pfnFree
    A pointer to a function that is called to free an existing host memory allocation.

pfnInternalAllocation
    A pointer to a function that is called to make short-lived internal allocations.

pfnInternalFree
    A pointer to a function that is called to free internal allocations.

DESCRIPTION

This structure is contains pointers to callback functions that are used to create, reallocate and free host memory allocations on behalf of a Vulkan implementation. The pUserData member of the structure is passed to each of the callback functions when they are called. It is otherwise not accessed by the Vulkan implementation and its intended use is that the host application use it to store state information related to memory allocation.

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

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.