[PATCH] D122922: [lld][common][lld-macho][lld-coff] Support per-thread allocators and StringSavers

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 13:20:32 PDT 2022


oontvoo added inline comments.


================
Comment at: lld/Common/Memory.cpp:41
+    llvm::sys::ScopedWriter lock(contextMutex);
+    perThreadContexts.push_back(&threadContext);
+  }
----------------
tschuett wrote:
> Would an assert on `perThreadContexts.size() < FOO` be helpful?
the `.size()` means the number of threads ever created by this process.  (note: it is **NOT** the number of threads that run concurrently). As such, I'm not sure we care what the limit is. (other than that if it runs out of memory it'll crash, but then we'd get a stacktrace and that's useful enough) 
Can you clarify why we should cap this?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122922/new/

https://reviews.llvm.org/D122922



More information about the llvm-commits mailing list