diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/AllocationPool.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/AllocationPool.h b/src/AllocationPool.h index 88bc132e9..cac5689b9 100644 --- a/src/AllocationPool.h +++ b/src/AllocationPool.h @@ -18,10 +18,15 @@ public: virtual ~cAllocationPool() {} + /** Allocates a pointer to T **/ virtual T * Allocate() = 0; + + /** Frees the pointer passed in a_ptr, invalidating it **/ virtual void Free(T * a_ptr) = 0; }; +/** Allocates memory storing unused elements in a linked list. Keeps at least NumElementsInReserve + elements in the list unless malloc fails so that the program has a reserve to handle OOM.**/ template<class T, size_t NumElementsInReserve> class cListAllocationPool : public cAllocationPool<T> { |