summaryrefslogtreecommitdiff
path: root/lib/Support/Allocator.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-03-30 20:16:45 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-03-30 20:16:45 +0000
commit991de14dd62dcbab4b31357ae22dc5b053ba50a0 (patch)
treebda68de401067e89361cd37e175d087fe0b3e6f1 /lib/Support/Allocator.cpp
parent820580dfa9ed3e70d3eda06138a59fd903f61b7a (diff)
downloadllvm-991de14dd62dcbab4b31357ae22dc5b053ba50a0.tar.gz
llvm-991de14dd62dcbab4b31357ae22dc5b053ba50a0.tar.bz2
llvm-991de14dd62dcbab4b31357ae22dc5b053ba50a0.tar.xz
Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction typesafe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Allocator.cpp')
-rw-r--r--lib/Support/Allocator.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp
index 7433247c23..31b45c8d4a 100644
--- a/lib/Support/Allocator.cpp
+++ b/lib/Support/Allocator.cpp
@@ -78,21 +78,6 @@ void BumpPtrAllocator::Reset() {
End = ((char*)CurSlab) + CurSlab->Size;
}
-void BumpPtrAllocator::Reset(size_t Size, size_t Alignment, DTorFunction DTor) {
- if (Alignment == 0) Alignment = 1;
- MemSlab *Slab = CurSlab;
- while (Slab) {
- char *End = Slab == CurSlab ? CurPtr : (char*)Slab + Slab->Size;
- for (char *Ptr = (char*)Slab+1; Ptr < End; Ptr += Size) {
- Ptr = AlignPtr(Ptr, Alignment);
- if (Ptr + Size <= End)
- DTor(Ptr);
- }
- Slab = Slab->NextPtr;
- }
- Reset();
-}
-
/// Allocate - Allocate space at the specified alignment.
///
void *BumpPtrAllocator::Allocate(size_t Size, size_t Alignment) {