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 the pfnReallocation member of the VkAllocationCallbacks struct.

    The function must alter the size of the allocation pOriginal, either by shrinking or growing it, to accommodate the new size.

    If pOriginal is NULL, then pfnReallocation must behave similarly to VkAllocationFunction. If size is zero, then pfnReallocation must behave similarly to VkFreeFunction. The contents of the original allocation from bytes zero to min(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. If pOriginal 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 return NULL and not free the old allocation.

    • Method Detail

      • address

        default long address()
        Description copied from interface: Pointer
        Returns the raw pointer address as a long value.
        Specified by:
        address in interface Pointer
        Returns:
        the pointer address
      • callback

        default long callback(long args)
        Description copied from interface: CallbackI.P
        Will be called by native code.
        Specified by:
        callback in interface CallbackI.P
        Parameters:
        args - pointer to a DCArgs 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 for VkAllocationCallbacks.pUserData in the allocator specified by the application
        pOriginal - must be either NULL or a pointer previously returned by pfnReallocation or pfnAllocation of the same allocator
        size - the size in bytes of the requested allocation
        alignment - the requested alignment of the allocation in bytes and must be a power of two
        allocationScope - a VkSystemAllocationScope value specifying the scope of the lifetime of the allocation