diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/Allocator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp index 234fd41..e68c3e2 100644 --- a/lib/Support/Allocator.cpp +++ b/lib/Support/Allocator.cpp @@ -92,6 +92,12 @@ BumpPtrAllocator::~BumpPtrAllocator() { ((MemRegion*)TheMemory)->Deallocate(); } +void BumpPtrAllocator::Reset() { + ((MemRegion*)TheMemory)->Deallocate(); + TheMemory = malloc(4096); + ((MemRegion*)TheMemory)->Init(4096, 1, 0); +} + void *BumpPtrAllocator::Allocate(unsigned Size, unsigned Align) { MemRegion *MRP = (MemRegion*)TheMemory; void *Ptr = MRP->Allocate(Size, Align, &MRP); |