From: Jason Ekstrand Date: Fri, 31 Jul 2015 16:44:40 +0000 (-0700) Subject: vk/device: Mark newly allocated memory as undefined for valgrind X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f050aaa15ec6bd521eff013808ac151cec9abda;p=mesa.git vk/device: Mark newly allocated memory as undefined for valgrind This way valgrind still works even if the client gives us memory that has been initialized or re-uses memory for some reason. --- diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index 01eff02d25d..9217be79306 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -844,10 +844,10 @@ anv_device_alloc(struct anv_device * device, size_t alignment, VkSystemAllocType allocType) { - return device->instance->pfnAlloc(device->instance->pAllocUserData, - size, - alignment, - allocType); + void *mem = device->instance->pfnAlloc(device->instance->pAllocUserData, + size, alignment, allocType); + VG(VALGRIND_MAKE_MEM_UNDEFINED(mem, size)); + return mem; } void