diff options
Diffstat (limited to 'include/llvm/Support/Recycler.h')
-rw-r--r-- | include/llvm/Support/Recycler.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Support/Recycler.h b/include/llvm/Support/Recycler.h index fa6e189..bcc561d 100644 --- a/include/llvm/Support/Recycler.h +++ b/include/llvm/Support/Recycler.h @@ -22,6 +22,8 @@ namespace llvm { +class BumpPtrAllocator; + /// PrintRecyclingAllocatorStats - Helper for RecyclingAllocator for /// printing statistics. /// @@ -87,6 +89,15 @@ public: } } + /// Special case for BumpPtrAllocator which has an empty Deallocate() + /// function. + /// + /// There is no need to traverse the free list, pulling all the objects into + /// cache. + void clear(BumpPtrAllocator&) { + FreeList.clearAndLeakNodesUnsafely(); + } + template<class SubClass, class AllocatorType> SubClass *Allocate(AllocatorType &Allocator) { assert(sizeof(SubClass) <= Size && |