labath accepted this revision.
labath added a comment.

In case you have an idea of what's the "typical" number of objects in shared 
cluster, then we can tune the integer template parameter (in case we usually 
have more than 16 objects, then the inline storage is just wasting space, and 
we could reduce it).



================
Comment at: lldb/include/lldb/Utility/SharedCluster.h:52
   ClusterManager() : m_objects() {}
-
-  llvm::SmallVector<T *, 16> m_objects;
+  llvm::SmallPtrSet<T *, 16> m_objects;
   std::mutex m_mutex;
----------------
JDevlieghere wrote:
> I assume pointers cannot be modified once they're in the set. Can this be 
> `const T *`? 
Did you mean pointers temselves, or the objects they point to? The pointers are 
automatically const (you can't modify the map copy in-place), and if someone 
wanted to store const objects, he could always instantiate this class with 
`const T` instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131996

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to