@ -50,6 +50,9 @@ public:
Arena ( void * base , size_t size , size_t alignment ) ;
Arena ( void * base , size_t size , size_t alignment ) ;
virtual ~ Arena ( ) ;
virtual ~ Arena ( ) ;
Arena ( const Arena & other ) = delete ; // non construction-copyable
Arena & operator = ( const Arena & ) = delete ; // non copyable
/** Memory statistics. */
/** Memory statistics. */
struct Stats
struct Stats
{
{
@ -85,9 +88,6 @@ public:
*/
*/
bool addressInArena ( void * ptr ) const { return ptr > = base & & ptr < end ; }
bool addressInArena ( void * ptr ) const { return ptr > = base & & ptr < end ; }
private :
private :
Arena ( const Arena & other ) = delete ; // non construction-copyable
Arena & operator = ( const Arena & ) = delete ; // non copyable
/** Map of chunk address to chunk information. This class makes use of the
/** Map of chunk address to chunk information. This class makes use of the
* sorted order to merge previous and next chunks during deallocation .
* sorted order to merge previous and next chunks during deallocation .
*/
*/
@ -153,6 +153,9 @@ public:
explicit LockedPool ( std : : unique_ptr < LockedPageAllocator > allocator , LockingFailed_Callback lf_cb_in = nullptr ) ;
explicit LockedPool ( std : : unique_ptr < LockedPageAllocator > allocator , LockingFailed_Callback lf_cb_in = nullptr ) ;
~ LockedPool ( ) ;
~ LockedPool ( ) ;
LockedPool ( const LockedPool & other ) = delete ; // non construction-copyable
LockedPool & operator = ( const LockedPool & ) = delete ; // non copyable
/** Allocate size bytes from this arena.
/** Allocate size bytes from this arena.
* Returns pointer on success , or 0 if memory is full or
* Returns pointer on success , or 0 if memory is full or
* the application tried to allocate 0 bytes .
* the application tried to allocate 0 bytes .
@ -168,9 +171,6 @@ public:
/** Get pool usage statistics */
/** Get pool usage statistics */
Stats stats ( ) const ;
Stats stats ( ) const ;
private :
private :
LockedPool ( const LockedPool & other ) = delete ; // non construction-copyable
LockedPool & operator = ( const LockedPool & ) = delete ; // non copyable
std : : unique_ptr < LockedPageAllocator > allocator ;
std : : unique_ptr < LockedPageAllocator > allocator ;
/** Create an arena from locked pages */
/** Create an arena from locked pages */