mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
vulkan/util: add vk_realloc2
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:
parent
8d22eb960b
commit
0eb67508bd
1 changed files with 12 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue