util/vma: Track size of free memory in heap
authorChad Versace <chadversary@chromium.org>
Thu, 8 Dec 2022 21:49:43 +0000 (13:49 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 16 Dec 2022 07:18:38 +0000 (07:18 +0000)
commit94a6384f1b7785d255f66b5d5c237c98f6611760
tree94fe164fb7e7a816c2f83385998ac796d41b8b45
parent766508f56a416aec14c0fa1cedda18d8ea270999
util/vma: Track size of free memory in heap

This allows users to detect fragmentation on allocation failure.
If heap allocation fails but the allocation size is not larger than the
total free size, then the allocation failed due to fragmentation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20289>
src/util/vma.c
src/util/vma.h