12 #ifndef ROC_CORE_IPOOL_H_
13 #define ROC_CORE_IPOOL_H_
63 return pool.allocate();
#define ROC_ATTR_NODISCARD
Emit warning if function result is not checked.
virtual ROC_ATTR_NODISCARD bool reserve(size_t n_objects)=0
Reserve memory for given number of objects.
virtual size_t allocation_size() const =0
Get size of the allocation per object. Covers all internal overhead, if any.
virtual size_t object_size() const =0
Get size of the object (without overhead).
virtual void deallocate(void *memory)=0
Return memory to pool.
virtual void * allocate()=0
Allocate memory for an object.
void destroy_object(T &object)
Destroy object and deallocate its memory.
#define roc_panic_if(x)
Panic if condition is true.
Commonly used types and functions.