12 #ifndef ROC_CORE_IALLOCATOR_H_
13 #define ROC_CORE_IALLOCATOR_H_
37 template <
class T>
void destroy(T&
object) {
49 inline void*
operator new(
size_t size,
51 return allocator.allocate(size);
57 inline void*
operator new[](
size_t size,
59 return allocator.allocate(size);
67 allocator.deallocate(ptr);
74 inline void operator delete[](
void* ptr,
76 allocator.deallocate(ptr);
#define ROC_ATTR_NOTHROW
Function never throws.
Memory allocator interface.
virtual void deallocate(void *)=0
Deallocate previously allocated memory.
virtual void * allocate(size_t size)=0
Allocate memory.
void destroy(T &object)
Destroy object and deallocate its memory.
Commonly used types and functions.