From 8cd909e7497f414b22067aca30a34d301009d440 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 19 Dec 2014 14:45:19 +0000 Subject: [PATCH] [sanitizer] Rename InitIfLinkerInitialized to InitLinkerInitialized. llvm-svn: 224577 --- compiler-rt/lib/lsan/lsan_allocator.cc | 2 +- compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler-rt/lib/lsan/lsan_allocator.cc b/compiler-rt/lib/lsan/lsan_allocator.cc index c2c2c8b..96a2b04 100644 --- a/compiler-rt/lib/lsan/lsan_allocator.cc +++ b/compiler-rt/lib/lsan/lsan_allocator.cc @@ -47,7 +47,7 @@ static Allocator allocator; static THREADLOCAL AllocatorCache cache; void InitializeAllocator() { - allocator.InitIfLinkerInitialized(common_flags()->allocator_may_return_null); + allocator.InitLinkerInitialized(common_flags()->allocator_may_return_null); } void AllocatorThreadFinish() { diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h index 71930ba..d3723eb 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h @@ -211,7 +211,7 @@ class AllocatorStats { void Init() { internal_memset(this, 0, sizeof(*this)); } - void InitIfLinkerInitialized() {} + void InitLinkerInitialized() {} void Add(AllocatorStat i, uptr v) { v += atomic_load(&stats_[i], memory_order_relaxed); @@ -241,13 +241,13 @@ class AllocatorStats { // Global stats, used for aggregation and querying. class AllocatorGlobalStats : public AllocatorStats { public: - void InitIfLinkerInitialized() { + void InitLinkerInitialized() { next_ = this; prev_ = this; } void Init() { internal_memset(this, 0, sizeof(*this)); - InitIfLinkerInitialized(); + InitLinkerInitialized(); } void Register(AllocatorStats *s) { @@ -1006,14 +1006,14 @@ struct SizeClassAllocatorLocalCache { template class LargeMmapAllocator { public: - void InitIfLinkerInitialized(bool may_return_null) { + void InitLinkerInitialized(bool may_return_null) { page_size_ = GetPageSizeCached(); atomic_store(&may_return_null_, may_return_null, memory_order_relaxed); } void Init(bool may_return_null) { internal_memset(this, 0, sizeof(*this)); - InitIfLinkerInitialized(may_return_null); + InitLinkerInitialized(may_return_null); } void *Allocate(AllocatorStats *stat, uptr size, uptr alignment) { @@ -1266,9 +1266,9 @@ class CombinedAllocator { atomic_store(&may_return_null_, may_return_null, memory_order_relaxed); } - void InitIfLinkerInitialized(bool may_return_null) { - secondary_.InitIfLinkerInitialized(may_return_null); - stats_.InitIfLinkerInitialized(); + void InitLinkerInitialized(bool may_return_null) { + secondary_.InitLinkerInitialized(may_return_null); + stats_.InitLinkerInitialized(); InitCommon(may_return_null); } -- 2.7.4