Fixed case of spamming dedicated allocations instead of bigger blocks and thus and exceeding maxMemoryAllocationCount when heap size/budget is reached or exceeded.
Added debug macro VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT.
- When bufferImageGranularity == allocaAlignment the worst case is actually already evaluated
- When result offset and allocation size are already aligned, it is not possible for the 'page' to be shared
In both scenarios, a lot of work can be saved by simply not scanning suballocations. When dealing with many tiny allocations, this adds up a lot!
The only change this commit makes is to drop trailing whitespace.
This makes contributions easier for folks whose editors are set up
to automatically remove such whitespace on save.
Our internal static analysis flags potentially unsafe midpoint
calculations. The proposed fix ensures the binary search doesn't
overflow at the cost of a single additional operation.
The 10.15 SDK only declares it for C++17 and C11. In Chromium, we only
call this from .cc files, and these are C++14 still for now.
The 11.0 SDK declares it independent of language version (as long as
__DARWIN_C_LEVEL >= __DARWIN_C_FULL, which it is by default, at least
on macOS).
So this calls the system version in fewer scenarios than possible,
but it keeps the preprocessor checks fairly small.
Bug: chromium:1098741
Change-Id: I1e30f88bb040876bca2b59adee0a1cff33b9ff03
I pasted this from the _aligned_malloc() branch, and _aligned_malloc()
apparently has the argments swapped compared to aligned_alloc() :/
Bug: chromium:1098741
Change-Id: Iddd92a7beb9e75ddc63b96f757457ec4258fd1ca
The 11.0 SDK adds a declaration of aligned_malloc() that's available
on macOS 10.15 and later. vulkan_memory_allocator also defines a
symbol with the same name, which causes problems.
As fix, rename the vulkan_memory_allocator version to
vma_aligned_malloc(). Use this opportunity to use the same mechanism on
Windows (a no-op), and, while here, call the system aligned_malloc()
on macOS 10.15 from there too.
Bug: chromium:1098741
Change-Id: If738a1451a08c0813532fc4b778d9118a23210b7
Closes#119
Added internal class VmaSmallVector.
Refactored common code into a new function VmaAllocator_T::GetFlushOrInvalidateRange.
Regenerated docs.