org.lwjgl.vulkan.VkFreeFunctionI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwjgl-vulkan Show documentation
Show all versions of lwjgl-vulkan Show documentation
A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* Application-defined memory free function.
*
* C Specification
*
* The type of {@code pfnFree} is:
*
*
* typedef void (VKAPI_PTR *PFN_vkFreeFunction)(
* void* pUserData,
* void* pMemory);
*
* Description
*
* {@code pMemory} may be {@code NULL}, which the callback must handle safely. If {@code pMemory} is non-{@code NULL}, it must be a pointer previously allocated by {@code pfnAllocation} or {@code pfnReallocation}. The application should free this memory.
*
* See Also
*
* {@link VkAllocationCallbacks}
*/
@FunctionalInterface
@NativeType("PFN_vkFreeFunction")
public interface VkFreeFunctionI extends CallbackI {
FFICIF CIF = apiCreateCIF(
apiStdcall(),
ffi_type_void,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
}
/**
* Application-defined memory free function.
*
* @param pUserData the value specified for {@link VkAllocationCallbacks}{@code ::pUserData} in the allocator specified by the application.
* @param pMemory the allocation to be freed.
*/
void invoke(@NativeType("void *") long pUserData, @NativeType("void *") long pMemory);
}