@@ -77,6 +77,7 @@ See also: [product page on GPUOpen](https://gpuopen.com/gaming-product/vulkan-me
77
77
- [Memory initialization](@ref debugging_memory_usage_initialization)
78
78
- [Margins](@ref debugging_memory_usage_margins)
79
79
- [Corruption detection](@ref debugging_memory_usage_corruption_detection)
80
+ - [Leak detection features](@ref debugging_memory_usage_leak_detection)
80
81
- \subpage other_api_interop
81
82
- \subpage usage_patterns
82
83
- [GPU-only resource](@ref usage_patterns_gpu_only)
@@ -17842,6 +17843,19 @@ Margin validation (corruption detection) works only for memory types that are
17842
17843
`HOST_VISIBLE` and `HOST_COHERENT`.
17843
17844
17844
17845
17846
+ \section debugging_memory_usage_leak_detection Leak detection features
17847
+
17848
+ At allocation and allocator destruction time VMA checks for unfreed and unmapped blocks using
17849
+ `VMA_ASSERT_LEAK()`. This macro defaults to an assertion, triggering a typically fatal error in Debug
17850
+ builds, and doing nothing in Release builds. You can provide your own definition of `VMA_ASSERT_LEAK()`
17851
+ to change this behavior.
17852
+
17853
+ At memory block destruction time VMA lists out all unfreed allocations using the `VMA_LEAK_LOG_FORMAT()`
17854
+ macro, which defaults to `VMA_DEBUG_LOG_FORMAT`, which in turn defaults to a no-op.
17855
+ If you're having trouble with leaks - for example, the aforementioned assertion triggers, but you don't
17856
+ quite know \em why -, overriding this macro to print out the the leaking blocks, combined with assigning
17857
+ individual names to allocations using vmaSetAllocationName(), can greatly aid in fixing them.
17858
+
17845
17859
\page other_api_interop Interop with other graphics APIs
17846
17860
17847
17861
VMA provides some features that help with interoperability with other graphics APIs, e.g. OpenGL.
0 commit comments