All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.vulkan.VkReallocationFunctionI Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 3.3.4
Show newest version
/*
 * 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 static org.lwjgl.system.dyncall.DynCallback.*;

/**
 * Application-defined memory reallocation function.
 * 
 * 
C Specification
* *

The type of {@code pfnReallocation} is:

* *
 * typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)(
 *     void*                                       pUserData,
 *     void*                                       pOriginal,
 *     size_t                                      size,
 *     size_t                                      alignment,
 *     VkSystemAllocationScope                     allocationScope);
* *
Description
* *

{@code pfnReallocation} must return an allocation with enough space for {@code size} bytes, and the contents of the original allocation from bytes zero to min(original size, new size) - 1 must be preserved in the returned allocation. If {@code size} is larger than the old size, the contents of the additional space are undefined. If satisfying these requirements involves creating a new allocation, then the old allocation should be freed.

* *

If {@code pOriginal} is {@code NULL}, then {@code pfnReallocation} must behave equivalently to a call to {@link VkAllocationFunction} with the same parameter values (without {@code pOriginal}).

* *

If {@code size} is zero, then {@code pfnReallocation} must behave equivalently to a call to {@link VkFreeFunction} with the same {@code pUserData} parameter value, and {@code pMemory} equal to {@code pOriginal}.

* *

If {@code pOriginal} is non-{@code NULL}, the implementation must ensure that {@code alignment} is equal to the {@code alignment} used to originally allocate {@code pOriginal}.

* *

If this function fails and {@code pOriginal} is non-{@code NULL} the application must not free the old allocation.

* *

{@code pfnReallocation} must follow the same rules for return values as tname:PFN_vkAllocationFunction.

* *
See Also
* *

{@link VkAllocationCallbacks}

*/ @FunctionalInterface @NativeType("PFN_vkReallocationFunction") public interface VkReallocationFunctionI extends CallbackI.P { String SIGNATURE = Callback.__stdcall("(ppppi)p"); @Override default String getSignature() { return SIGNATURE; } @Override default long callback(long args) { return invoke( dcbArgPointer(args), dcbArgPointer(args), dcbArgPointer(args), dcbArgPointer(args), dcbArgInt(args) ); } /** * Application-defined memory reallocation function. * * @param pUserData the value specified for {@link VkAllocationCallbacks}{@code ::pUserData} in the allocator specified by the application. * @param pOriginal must be either {@code NULL} or a pointer previously returned by {@code pfnReallocation} or {@code pfnAllocation} of the same allocator. * @param size the size in bytes of the requested allocation. * @param alignment the requested alignment of the allocation in bytes and must be a power of two. * @param allocationScope a {@code VkSystemAllocationScope} value specifying the allocation scope of the lifetime of the allocation, as described here. */ @NativeType("void *") long invoke(@NativeType("void *") long pUserData, @NativeType("void *") long pOriginal, @NativeType("size_t") long size, @NativeType("size_t") long alignment, @NativeType("VkSystemAllocationScope") int allocationScope); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy