MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / ValidateMagicValueAfterAllocation

Method ValidateMagicValueAfterAllocation

include/vk_mem_alloc.h:10852–10870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10850}
10851
10852VkResult VmaDeviceMemoryBlock::ValidateMagicValueAfterAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
10853{
10854 VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
10855
10856 void* pData = VMA_NULL;
10857 VkResult res = Map(hAllocator, 1, &pData);
10858 if (res != VK_SUCCESS)
10859 {
10860 return res;
10861 }
10862
10863 if (!VmaValidateMagicValue(pData, allocOffset + allocSize))
10864 {
10865 VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER FREED ALLOCATION!");
10866 }
10867
10868 Unmap(hAllocator, 1);
10869 return VK_SUCCESS;
10870}
10871
10872VkResult VmaDeviceMemoryBlock::BindBufferMemory(
10873 VmaAllocator hAllocator,

Callers 1

FreeMethod · 0.80

Calls 2

VmaValidateMagicValueFunction · 0.85
MapClass · 0.50

Tested by

no test coverage detected