Index: base/memory/singleton.h |
diff --git a/base/memory/singleton.h b/base/memory/singleton.h |
index bc4684b0b8940acf87ca016341465764967a26ab..f82a37ec865da1a966cb3b3681d2d1edf4ba1427 100644 |
--- a/base/memory/singleton.h |
+++ b/base/memory/singleton.h |
@@ -213,8 +213,11 @@ class Singleton { |
// Return a pointer to the one true instance of the class. |
static Type* get() { |
+#ifndef NDEBUG |
+ // Avoid making TLS lookup on release builds. |
if (!Traits::kAllowedToAccessOnNonjoinableThread) |
base::ThreadRestrictions::AssertSingletonAllowed(); |
+#endif |
// Our AtomicWord doubles as a spinlock, where a value of |
// kBeingCreatedMarker means the spinlock is being held for creation. |