vulkan/util: add vk_realloc2
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35998>
This commit is contained in:
Luigi Santivetti 2025-04-08 14:46:06 +01:00 committed by Marge Bot
parent 8d22eb960b
commit 0eb67508bd

View file

@ -149,6 +149,18 @@ vk_zalloc2(const VkAllocationCallbacks *parent_alloc,
return mem;
}
static inline void *
vk_realloc2(const VkAllocationCallbacks *parent_alloc,
const VkAllocationCallbacks *alloc,
void *ptr, size_t size, size_t align,
VkSystemAllocationScope scope)
{
if (alloc)
return vk_realloc(alloc, ptr, size, align, scope);
else
return vk_realloc(parent_alloc, ptr, size, align, scope);
}
static inline void
vk_free2(const VkAllocationCallbacks *parent_alloc,
const VkAllocationCallbacks *alloc,