aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-15 23:29:34 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-15 23:29:34 +0000
commit67c59826bf0c2e980130781d1ea0d6b062e4b659 (patch)
treee5c5ebeacb93b22f82a7d2dfb10a34b249bad34d /lib/Support
parent9a23981ecc3549bd7e9dc3b5a6ae228e92dd6ce8 (diff)
downloadexternal_llvm-67c59826bf0c2e980130781d1ea0d6b062e4b659.zip
external_llvm-67c59826bf0c2e980130781d1ea0d6b062e4b659.tar.gz
external_llvm-67c59826bf0c2e980130781d1ea0d6b062e4b659.tar.bz2
BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not initialization time. This removes one of the 'init_constructors' reported in <rdar://problem/7545356>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/Allocator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp
index 31b45c8..19d69f6 100644
--- a/lib/Support/Allocator.cpp
+++ b/lib/Support/Allocator.cpp
@@ -142,8 +142,10 @@ void BumpPtrAllocator::PrintStats() const {
<< " (includes alignment, etc)\n";
}
-MallocSlabAllocator BumpPtrAllocator::DefaultSlabAllocator =
- MallocSlabAllocator();
+MallocSlabAllocator &BumpPtrAllocator::GetDefaultSlabAllocator() {
+ static MallocSlabAllocator DefaultSlabAllocator;
+ return DefaultSlabAllocator;
+}
SlabAllocator::~SlabAllocator() { }