summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rw-r--r--third_party/tcmalloc/chromium/src/thread_cache.cc4
-rw-r--r--third_party/tcmalloc/chromium/src/thread_cache.h11
2 files changed, 13 insertions, 2 deletions
diff --git a/third_party/tcmalloc/chromium/src/thread_cache.cc b/third_party/tcmalloc/chromium/src/thread_cache.cc
index 765786ff..1ad0f6d 100644
--- a/third_party/tcmalloc/chromium/src/thread_cache.cc
+++ b/third_party/tcmalloc/chromium/src/thread_cache.cc
@@ -64,7 +64,9 @@ int ThreadCache::thread_heap_count_ = 0;
ThreadCache* ThreadCache::next_memory_steal_ = NULL;
#ifdef HAVE_TLS
__thread ThreadCache* ThreadCache::threadlocal_heap_
-# ifdef HAVE___ATTRIBUTE__
+// See comments in thread_cache.h about this. Bug here:
+// http://code.google.com/p/chromium/issues/detail?id=124489
+#if defined(HAVE___ATTRIBUTE__) && !defined(PGO_GENERATE)
__attribute__ ((tls_model ("initial-exec")))
# endif
;
diff --git a/third_party/tcmalloc/chromium/src/thread_cache.h b/third_party/tcmalloc/chromium/src/thread_cache.h
index 5294029..221cacb 100644
--- a/third_party/tcmalloc/chromium/src/thread_cache.h
+++ b/third_party/tcmalloc/chromium/src/thread_cache.h
@@ -259,7 +259,16 @@ class ThreadCache {
// a good tradeoff for us.
#ifdef HAVE_TLS
static __thread ThreadCache* threadlocal_heap_
-# ifdef HAVE___ATTRIBUTE__
+ // This code links against pyautolib.so, which causes dlopen() on that shared
+ // object to fail when -fprofile-generate is used with it. Ideally
+ // pyautolib.so should not link against this code. There is a bug filed for
+ // that:
+ // http://code.google.com/p/chromium/issues/detail?id=124489
+ // For now the workaround is to pass in -DPGO_GENERATE when building Chrome
+ // for instrumentation (-fprofile-generate).
+ // For all non-instrumentation builds, this define will not be set and the
+ // performance benefit of "intial-exec" will be achieved.
+#if defined(HAVE___ATTRIBUTE__) && !defined(PGO_GENERATE)
__attribute__ ((tls_model ("initial-exec")))
# endif
;