mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Change some Crash() to asserts in VulkanDeviceAllocator
This commit is contained in:
parent
d0c248368d
commit
ff264efe7e
1 changed files with 4 additions and 11 deletions
|
@ -287,14 +287,9 @@ void VulkanDeviceAllocator::Free(VkDeviceMemory deviceMemory, size_t offset) {
|
|||
}
|
||||
|
||||
auto it = slab.allocSizes.find(start);
|
||||
if (it == slab.allocSizes.end()) {
|
||||
// Ack, a double free?
|
||||
Crash();
|
||||
}
|
||||
if (slab.usage[start] != 1) {
|
||||
// This means a double free, while queued to actually free.
|
||||
Crash();
|
||||
}
|
||||
_assert_msg_(G3D, it != slab.allocSizes.end(), "Double free?");
|
||||
// This means a double free, while queued to actually free.
|
||||
_assert_msg_(G3D, slab.usage[start] == 1, "Double free when queued to free!");
|
||||
|
||||
// Mark it as "free in progress".
|
||||
slab.usage[start] = 2;
|
||||
|
@ -303,9 +298,7 @@ void VulkanDeviceAllocator::Free(VkDeviceMemory deviceMemory, size_t offset) {
|
|||
}
|
||||
|
||||
// Wrong deviceMemory even? Maybe it was already decimated, but that means a double-free.
|
||||
if (!found) {
|
||||
Crash();
|
||||
}
|
||||
_assert_msg_(G3D, found, "Failed to find allocation to free! Double-freed?");
|
||||
|
||||
// Okay, now enqueue. It's valid.
|
||||
FreeInfo *info = new FreeInfo(this, deviceMemory, offset);
|
||||
|
|
Loading…
Add table
Reference in a new issue