Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>tags/17.3-branchpoint
@@ -36,6 +36,20 @@ vk_alloc(const VkAllocationCallbacks *alloc, | |||
return alloc->pfnAllocation(alloc->pUserData, size, align, scope); | |||
} | |||
static inline void * | |||
vk_zalloc(const VkAllocationCallbacks *alloc, | |||
size_t size, size_t align, | |||
VkSystemAllocationScope scope) | |||
{ | |||
void *mem = vk_alloc(alloc, size, align, scope); | |||
if (mem == NULL) | |||
return NULL; | |||
memset(mem, 0, size); | |||
return mem; | |||
} | |||
static inline void * | |||
vk_realloc(const VkAllocationCallbacks *alloc, | |||
void *ptr, size_t size, size_t align, |