20 #ifndef KERNEL_UTILITY_OBJECT_POOL_H 21 #define KERNEL_UTILITY_OBJECT_POOL_H 23 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/LockGuard.h" 26 #include "pedigree/kernel/Spinlock.h" 28 #include "pedigree/kernel/utilities/Vector.h" 29 #include "pedigree/kernel/utilities/assert.h" 41 template <
class T,
size_t poolSize = 16>
56 for (
auto it = m_Pool.
begin(); it != m_Pool.
end(); ++it)
62 template <
typename... Args>
63 T *allocate(Args... args)
67 return new T(args...);
82 return new T(args...);
86 void deallocate(T *
object)
106 m_Pool.
reserve(poolSize,
true);
107 if (m_Pool.
count() < poolSize)
124 #endif // KERNEL_UTILITY_OBJECT_POOL_H void pushBack(const T &value)
void reserve(size_t size, bool copy)