aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Allocator.h
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
commitf988f191a3f56d8a24ba8ed97e7e8508d045fd9a (patch)
treee5c5ebeacb93b22f82a7d2dfb10a34b249bad34d /include/llvm/Support/Allocator.h
parentf6e1d0affe1223eb1d710232a2e31ed99f60c191 (diff)
downloadexternal_llvm-f988f191a3f56d8a24ba8ed97e7e8508d045fd9a.zip
external_llvm-f988f191a3f56d8a24ba8ed97e7e8508d045fd9a.tar.gz
external_llvm-f988f191a3f56d8a24ba8ed97e7e8508d045fd9a.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 'include/llvm/Support/Allocator.h')
-rw-r--r--include/llvm/Support/Allocator.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index b0ed33d..496496b 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -128,11 +128,11 @@ class BumpPtrAllocator {
/// one.
void DeallocateSlabs(MemSlab *Slab);
- static MallocSlabAllocator DefaultSlabAllocator;
+ static MallocSlabAllocator &GetDefaultSlabAllocator();
public:
BumpPtrAllocator(size_t size = 4096, size_t threshold = 4096,
- SlabAllocator &allocator = DefaultSlabAllocator);
+ SlabAllocator &allocator = GetDefaultSlabAllocator());
~BumpPtrAllocator();
/// Reset - Deallocate all but the current slab and reset the current pointer