12 #ifndef ROC_CORE_LIMITED_POOL_H_
13 #define ROC_CORE_LIMITED_POOL_H_
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
Decorator around IPool to make it memory limited.
virtual void deallocate(void *memory)
Return memory to pool, then update the memory limiter.
LimitedPool(IPool &pool, MemoryLimiter &memory_limiter)
Initialize.
virtual ROC_ATTR_NODISCARD bool reserve(size_t n_objects)
Reserve memory for given number of objects.
virtual size_t object_size() const
Get size of the object.
virtual size_t allocation_size() const
Get size of the allocation per object.
virtual void * allocate()
Allocate memory for an object, after checking with the memory limiter.
Memory limiter. This class can be used to keep track of memory being consumed. This is done through t...
Base class for non-copyable objects.