[compiler-rt] r179307 - [asan] inline flags(), up to 1% perf gain on malloc-intensive code
Kostya Serebryany
kcc at google.com
Thu Apr 11 11:36:04 PDT 2013
Author: kcc
Date: Thu Apr 11 13:36:04 2013
New Revision: 179307
URL: http://llvm.org/viewvc/llvm-project?rev=179307&view=rev
Log:
[asan] inline flags(), up to 1% perf gain on malloc-intensive code
Modified:
compiler-rt/trunk/lib/asan/asan_flags.h
compiler-rt/trunk/lib/asan/asan_rtl.cc
Modified: compiler-rt/trunk/lib/asan/asan_flags.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.h?rev=179307&r1=179306&r2=179307&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_flags.h (original)
+++ compiler-rt/trunk/lib/asan/asan_flags.h Thu Apr 11 13:36:04 2013
@@ -115,7 +115,10 @@ struct Flags {
bool strict_memcmp;
};
-Flags *flags();
+extern Flags asan_flags_dont_use_directly;
+inline Flags *flags() {
+ return &asan_flags_dont_use_directly;
+}
void InitializeFlags(Flags *f, const char *env);
} // namespace __asan
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=179307&r1=179306&r2=179307&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Thu Apr 11 13:36:04 2013
@@ -66,11 +66,7 @@ static void AsanCheckFailed(const char *
// -------------------------- Flags ------------------------- {{{1
static const int kDeafultMallocContextSize = 30;
-static Flags asan_flags;
-
-Flags *flags() {
- return &asan_flags;
-}
+Flags asan_flags_dont_use_directly; // use via flags().
static const char *MaybeCallAsanDefaultOptions() {
return (&__asan_default_options) ? __asan_default_options() : "";
More information about the llvm-commits
mailing list