//==- llvm/Support/Recycler.h - Recycling Allocator --------------*- C++ -*-==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the Recycler class template. See the doxygen comment for // Recycler for more details. // //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_RECYCLER_H #define LLVM_SUPPORT_RECYCLER_H #include "llvm/ADT/ilist.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> namespace llvm { /// PrintRecyclingAllocatorStats - Helper for RecyclingAllocator for /// printing statistics. /// void PrintRecyclerStats(size_t Size, size_t Align, size_t FreeListSize); /// Recycler - This class manages a linked-list of deallocated nodes /// and facilitates reusing deallocated memory in place of allocating /// new memory. /// template <class T, size_t Size = sizeof(T), size_t Align = alignof(T)> class Recycler { … }; template <class T, size_t Size, size_t Align> void Recycler<T, Size, Align>::PrintStats() { … } } #endif