[llvm] Reduce llvm-gsymutil memory usage (PR #91023)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 12:17:50 PDT 2024


================
@@ -658,6 +711,9 @@ void DWARFUnit::clearDIEs(bool KeepCUDie) {
   // It depends on the implementation whether the request is fulfilled.
   // Create a new vector with a small capacity and assign it to the DieArray to
   // have previous contents freed.
+  llvm::sys::ScopedWriter FreeLock(CUDieFreeMutex);
+  llvm::sys::ScopedWriter CULock(CUDieArrayMutex);
+  llvm::sys::ScopedWriter AllLock(AllDieArrayMutex);
----------------
dwblaikie wrote:

Yeah, sounds about right.

And perhaps once the other two are removed the code'll be basically the same as it was without this patch (except for two lock acquisitions) before and so a lot of the concerns/questions/issues (the newly subdivided functions and names are quite confusing to me, but I've deleted my comments on that so as not to confuse things further if it's all going away anyway) go away?

https://github.com/llvm/llvm-project/pull/91023


More information about the llvm-commits mailing list