| 8445 | } |
| 8446 | |
| 8447 | VkResult VmaBlockMetadata_Linear::CheckCorruption(const void* pBlockData) |
| 8448 | { |
| 8449 | VMA_ASSERT(!IsVirtual()); |
| 8450 | SuballocationVectorType& suballocations1st = AccessSuballocations1st(); |
| 8451 | for (size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i) |
| 8452 | { |
| 8453 | const VmaSuballocation& suballoc = suballocations1st[i]; |
| 8454 | if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) |
| 8455 | { |
| 8456 | if (!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size)) |
| 8457 | { |
| 8458 | VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!"); |
| 8459 | return VK_ERROR_UNKNOWN_COPY; |
| 8460 | } |
| 8461 | } |
| 8462 | } |
| 8463 | |
| 8464 | SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); |
| 8465 | for (size_t i = 0, count = suballocations2nd.size(); i < count; ++i) |
| 8466 | { |
| 8467 | const VmaSuballocation& suballoc = suballocations2nd[i]; |
| 8468 | if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) |
| 8469 | { |
| 8470 | if (!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size)) |
| 8471 | { |
| 8472 | VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!"); |
| 8473 | return VK_ERROR_UNKNOWN_COPY; |
| 8474 | } |
| 8475 | } |
| 8476 | } |
| 8477 | |
| 8478 | return VK_SUCCESS; |
| 8479 | } |
| 8480 | |
| 8481 | void VmaBlockMetadata_Linear::Alloc( |
| 8482 | const VmaAllocationRequest& request, |
no test coverage detected