12#ifndef ROC_CORE_IPOOL_H_
13#define ROC_CORE_IPOOL_H_
59 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 object_size() const =0
Get size of object allocated by pool.
virtual void * allocate()=0
Allocate memory for an object.
virtual void deallocate(void *memory)=0
Return memory to pool.
void destroy_object(T &object)
Destroy object and deallocate its memory.
Shared ownership intrusive pointer.
#define roc_panic_if_not(x)
Panic if condition is false.
Commonly used types and functions.