Add more OOM handling paths and refactor OOM tests
authorCharles Giessen <charles@lunarg.com>
Fri, 18 Nov 2022 00:20:17 +0000 (17:20 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Mon, 21 Nov 2022 21:47:52 +0000 (14:47 -0700)
commit3a092fe869f6c5f152aa9a52b8064bb9b6bf9c93
tree642af34ec7deabbc0e178270bb04f6d618b33258
parent6c7b2db415f07e6c6489c596144693602ecece07
Add more OOM handling paths and refactor OOM tests

There were more cases where OOM wasn't being propagated correctly, or
even caught in the first place. This change makes all of those paths
report OOM to the application as is expected. One case was due to linux
sorting erroring out but then leaking memory, which wasn't caught because
the tests didn't create devices that supported PhysDevProps2.

Lastly, since the Allocation tests were taking much longer due to making
many more allocations, the MemoryTracker was rewritten to use
std::unordered_map to speed up insertion and lookup of allocations made.
loader/loader.c
loader/loader.h
loader/loader_environment.c
tests/loader_alloc_callback_tests.cpp