BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not initializatio...
[oota-llvm.git] / lib / Support / Allocator.cpp
index 31b45c8d4aae77538940f8f1b9e948f7f2726e23..19d69f6f944dfaec5c10fbc2c89887994f00f07e 100644 (file)
@@ -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() { }