instance->apiVersion = pCreateInfo->pAppInfo->apiVersion;
instance->physicalDeviceCount = 0;
+ VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false));
+
*pInstance = anv_instance_to_handle(instance);
return VK_SUCCESS;
anv_physical_device_finish(&instance->physicalDevice);
}
+ VG(VALGRIND_DESTROY_MEMPOOL(instance));
+
instance->pfnFree(instance->pAllocUserData, instance);
return VK_SUCCESS;
{
void *mem = instance->pfnAlloc(instance->pAllocUserData,
size, alignment, allocType);
- VG(VALGRIND_MAKE_MEM_UNDEFINED(mem, size));
+ if (mem) {
+ VALGRIND_MEMPOOL_ALLOC(instance, mem, size);
+ VALGRIND_MAKE_MEM_UNDEFINED(mem, size);
+ }
return mem;
}
if (mem == NULL)
return;
+ VALGRIND_MEMPOOL_FREE(instance, mem);
+
instance->pfnFree(instance->pAllocUserData, mem);
}