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

Unified Diff: base/allocator/allocator_shim.cc

Issue 1777363002: Improve performance of the malloc shim layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_shim.cc
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index cc5097ec543cd589afc7e306b6963481b46be2ba..f68903503655605a9d8ac2fdc5ba5909c5be8963 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -72,8 +72,16 @@ bool CallNewHandler() {
}
inline const allocator::AllocatorDispatch* GetChainHead() {
+ // TODO(primiano): Just use NoBarrier_Load once crbug.com/593344 is fixed.
Nico 2016/03/10 22:50:00 (filed crbug.com/593874 today and made 3344 blocke
Primiano Tucci (use gerrit) 2016/03/11 00:11:08 Seen that. Thanks.
+ // Unfortunately due to that bug NoBarrier_Load() is mistakenly fully
+ // barriered on Linux+Clang, and that causes visible perf regressons.
return reinterpret_cast<const allocator::AllocatorDispatch*>(
- subtle::NoBarrier_Load(&g_chain_head));
+#if defined(OS_LINUX) && defined(__clang__)
Nico 2016/03/10 22:50:00 Do we want to check for x86 too?
Primiano Tucci (use gerrit) 2016/03/11 00:11:08 Especially for x86, which is where I saw the bug :
Nico 2016/03/11 15:42:04 I mean on ARM fences are pretty different, so I'm
+ *static_cast<const volatile subtle::AtomicWord*>(&g_chain_head)
+#else
+ subtle::NoBarrier_Load(&g_chain_head)
+#endif
+ );
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698