Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Side by Side Diff: third_party/tcmalloc/chromium/src/thread_cache.cc

Issue 2640263003: tcmalloc: Use the default TLS model on arm-gcc, CrOS only. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/tcmalloc/chromium/src/thread_cache.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 size_t ThreadCache::overall_thread_cache_size_ = kDefaultOverallThreadCacheSize; 59 size_t ThreadCache::overall_thread_cache_size_ = kDefaultOverallThreadCacheSize;
60 ssize_t ThreadCache::unclaimed_cache_space_ = kDefaultOverallThreadCacheSize; 60 ssize_t ThreadCache::unclaimed_cache_space_ = kDefaultOverallThreadCacheSize;
61 PageHeapAllocator<ThreadCache> threadcache_allocator; 61 PageHeapAllocator<ThreadCache> threadcache_allocator;
62 ThreadCache* ThreadCache::thread_heaps_ = NULL; 62 ThreadCache* ThreadCache::thread_heaps_ = NULL;
63 int ThreadCache::thread_heap_count_ = 0; 63 int ThreadCache::thread_heap_count_ = 0;
64 ThreadCache* ThreadCache::next_memory_steal_ = NULL; 64 ThreadCache* ThreadCache::next_memory_steal_ = NULL;
65 #ifdef HAVE_TLS 65 #ifdef HAVE_TLS
66 __thread ThreadCache* ThreadCache::threadlocal_heap_ 66 __thread ThreadCache* ThreadCache::threadlocal_heap_
67 // See comments in thread_cache.h about this. Bug here: 67 // See comments in thread_cache.h about this. Bug here:
68 // http://code.google.com/p/chromium/issues/detail?id=124489 68 // http://code.google.com/p/chromium/issues/detail?id=124489
69 #if defined(HAVE___ATTRIBUTE__) && !defined(PGO_GENERATE) 69 //
70 // gcc has a problem with this tls model on arm.
71 // See https://bugs.chromium.org/p/chromium/issues/detail?id=650137
72 #if defined(HAVE___ATTRIBUTE__) && !defined(PGO_GENERATE) && \
73 (defined(__clang__) || !defined(OS_CHROMEOS) || !defined(__arm__))
llozano 2017/01/19 21:38:42 not gcc does not necessarily mean clang. Is it? I
llozano 2017/01/19 22:11:03 ah, but on ChromeOS .. not GCC implies clang..
laszio 2017/01/19 22:11:46 Done.
70 __attribute__ ((tls_model ("initial-exec"))) 74 __attribute__ ((tls_model ("initial-exec")))
71 # endif 75 # endif
72 ; 76 ;
73 #endif 77 #endif
74 bool ThreadCache::tsd_inited_ = false; 78 bool ThreadCache::tsd_inited_ = false;
75 pthread_key_t ThreadCache::heap_key_; 79 pthread_key_t ThreadCache::heap_key_;
76 80
77 #if defined(HAVE_TLS) 81 #if defined(HAVE_TLS)
78 bool kernel_supports_tls = false; // be conservative 82 bool kernel_supports_tls = false; // be conservative
79 # if defined(_WIN32) // windows has supported TLS since winnt, I think. 83 # if defined(_WIN32) // windows has supported TLS since winnt, I think.
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 void ThreadCache::set_overall_thread_cache_size(size_t new_size) { 509 void ThreadCache::set_overall_thread_cache_size(size_t new_size) {
506 // Clip the value to a reasonable range 510 // Clip the value to a reasonable range
507 if (new_size < kMinThreadCacheSize) new_size = kMinThreadCacheSize; 511 if (new_size < kMinThreadCacheSize) new_size = kMinThreadCacheSize;
508 if (new_size > (1<<30)) new_size = (1<<30); // Limit to 1GB 512 if (new_size > (1<<30)) new_size = (1<<30); // Limit to 1GB
509 overall_thread_cache_size_ = new_size; 513 overall_thread_cache_size_ = new_size;
510 514
511 RecomputePerThreadCacheSize(); 515 RecomputePerThreadCacheSize();
512 } 516 }
513 517
514 } // namespace tcmalloc 518 } // namespace tcmalloc
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/thread_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698