diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2013-04-08 18:41:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2013-04-08 18:41:23 +0000 |
commit | 4a16efa3e43e35f0cc9efe3a67f620f0017c3d36 (patch) | |
tree | 06099edc18d30894081a822b756f117cbe0b8207 /include/llvm/Support/Recycler.h | |
parent | 482e7bddf617ae804dc47133cb07eb4aa81e45de (diff) |
Notes
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 fa6e189e97bd0..bcc561db2d5cb 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 && |