[libcxx-commits] [libcxx] 0d546ff - [libc++] Fix "leak" of PMR resource in benchmark (#216114)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 06:02:30 PDT 2026


Author: Louis Dionne
Date: 2026-09-29T09:02:24-04:00
New Revision: 0d546ff00281aca3e0aa2b81573665f3ddb8b5b9

URL: https://github.com/llvm/llvm-project/commit/0d546ff00281aca3e0aa2b81573665f3ddb8b5b9
DIFF: https://github.com/llvm/llvm-project/commit/0d546ff00281aca3e0aa2b81573665f3ddb8b5b9.diff

LOG: [libc++] Fix "leak" of PMR resource in benchmark (#216114)

The benchmark was not releasing the monotonic buffer resource, which
means we'd grow a larger and larger pool as Google Benchmark would go
through more and more iterations of the benchmark.

Added: 
    

Modified: 
    libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h b/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
index 0291c650d891c..52d857b08811b 100644
--- a/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
+++ b/libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h
@@ -158,6 +158,7 @@ void associative_container_benchmarks(std::string container) {
       }
       rs2.release();
       srcs.clear();
+      rs.release();
       for (size_t i = 0; i != BatchSize; ++i)
         srcs.emplace_back(&rs).insert(in.begin(), in.end());
 


        


More information about the libcxx-commits mailing list