[scudo] Deallocate the AllocatorRingBuffer too in unmapTestOnly
authorFabio D'Urso <fdurso@google.com>
Tue, 16 May 2023 20:07:24 +0000 (20:07 +0000)
committerCaslyn Tonelli <caslyn@google.com>
Tue, 16 May 2023 20:09:08 +0000 (20:09 +0000)
commit0f1a92ba308a20dd4c790843191e3b642e90a9f3
tree71a1a65c803befb9acacb9b97357636bcf766b0e
parentec388adbbcbf2cf7f2743464ef5b3c5c540a2d23
[scudo] Deallocate the AllocatorRingBuffer too in unmapTestOnly

The AllocatorRingBuffer is allocated dynamically when Allocator is
initialized. This patch adds a corresponding deinitialization call in
unmapTestOnly, to avoid running out of virtual memory if the tests are run
a large number of times on memory-constrained platforms.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D149266
compiler-rt/lib/scudo/standalone/combined.h