[MSan] Linker-initialize static fallback_mutex in msan_allocator.cc
authorAlex Shlyapnikov <alekseys@google.com>
Thu, 14 Jun 2018 18:30:51 +0000 (18:30 +0000)
committerAlex Shlyapnikov <alekseys@google.com>
Thu, 14 Jun 2018 18:30:51 +0000 (18:30 +0000)
Summary:
static fallback_mutex in msan_allocator.cc does not need the ctor
call and can be linker initialized.

Issue: https://github.com/google/sanitizers/issues/194

Reviewers: morehouse, eugenis

Subscribers: delcypher, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D48145

llvm-svn: 334749

compiler-rt/lib/msan/msan_allocator.cc

index 3d03ca4..36f0497 100644 (file)
@@ -120,7 +120,7 @@ typedef CombinedAllocator<PrimaryAllocator, AllocatorCache,
 
 static Allocator allocator;
 static AllocatorCache fallback_allocator_cache;
-static SpinMutex fallback_mutex;
+static StaticSpinMutex fallback_mutex;
 
 void MsanAllocatorInit() {
   SetAllocatorMayReturnNull(common_flags()->allocator_may_return_null);