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.
virtual void deallocate(void *memory)
Return memory to pool, then update the memory limiter.
virtual void * allocate()
Allocate memory for an object, after checking with 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.
Memory limiter. This class can be used to keep track of memory being consumed. This is done through t...
General-purpose building blocks and platform abstraction layer.