[Lldb-commits] [PATCH] D13941: Fix some race condition in ConstString around Mangled name handling

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 21 09:48:46 PDT 2015


clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Looks fine. Might want to make "h" const in places noted by inlined comments, but other than that it looks good.


================
Comment at: source/Core/ConstString.cpp:39
@@ -38,2 +38,3 @@
         {
-            const StringPoolEntryType&entry = GetStringMapEntryFromKeyData (ccstr);
+            uint8_t h = hash (llvm::StringRef(ccstr));
+            llvm::sys::SmartScopedReader<false> rlock(m_string_pools[h].m_mutex);
----------------
const uint8_t h?

================
Comment at: source/Core/ConstString.cpp:52
@@ +51,3 @@
+        {
+            uint8_t h = hash (llvm::StringRef(ccstr));
+            llvm::sys::SmartScopedReader<false> rlock(m_string_pools[h].m_mutex);
----------------
const uint8_t h?

================
Comment at: source/Core/ConstString.cpp:65
@@ +64,3 @@
+            {
+                uint8_t h = hash (llvm::StringRef(key_ccstr));
+                llvm::sys::SmartScopedWriter<false> wlock(m_string_pools[h].m_mutex);
----------------
const uint8_t h?

================
Comment at: source/Core/ConstString.cpp:70
@@ +69,3 @@
+            {
+                uint8_t h = hash (llvm::StringRef(value_ccstr));
+                llvm::sys::SmartScopedWriter<false> wlock(m_string_pools[h].m_mutex);
----------------
const uint8_t h?

================
Comment at: source/Core/ConstString.cpp:139
@@ +138,3 @@
+                // mangled const string...
+                uint8_t h = hash (llvm::StringRef(mangled_ccstr));
+                llvm::sys::SmartScopedWriter<false> wlock(m_string_pools[h].m_mutex);
----------------
const uint8_t h?


http://reviews.llvm.org/D13941





More information about the lldb-commits mailing list