summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alk@tut.by>2015-10-03 15:40:21 -0700
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2015-10-05 21:05:43 -0700
commitfaea31f3f8297e4ff0106637a0717afbcda19d6b (patch)
tree751976a9019408b5d30c8d4c611675a398b0cd38
parenta6d48a623eba31b92ae545f665fe74960a5f0a58 (diff)
downloadgperftools-faea31f3f8297e4ff0106637a0717afbcda19d6b.tar.gz
slightly faster GetCacheIfPresent
-rw-r--r--src/thread_cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/thread_cache.h b/src/thread_cache.h
index 81a020e..61ee44d 100644
--- a/src/thread_cache.h
+++ b/src/thread_cache.h
@@ -417,7 +417,9 @@ inline ThreadCache* ThreadCache::GetCache() {
// because we may be in the thread destruction code and may have
// already cleaned up the cache for this thread.
inline ThreadCache* ThreadCache::GetCacheIfPresent() {
+#ifndef HAVE_TLS
if (!tsd_inited_) return NULL;
+#endif
return GetThreadHeap();
}