1 #ifndef __UTILS_SLABS_H__
2 #define __UTILS_SLABS_H__
5 #include <boost/cstdint.hpp>
32 typedef boost::uint8_t byte_t;
40 typedef std::vector<item_t*> Buffers;
42 static item_t* get_base(
void* ptr);
45 Buffers m_listpool, m_free;
61 struct safe_bool_struct
63 typedef void (safe_bool_struct::*safe_bool)();
72 delete[] dynamic_pool::get_base(m_ptr);
84 operator safe_bool()
const throw()
85 {
return m_ptr ? &safe_bool_struct::method : 0; }
87 T*
get()
throw() {
return m_ptr; }
88 T
const*
get()
const throw() {
return m_ptr; }
dynamic_auto(dynamic_auto const ©)
Definition: dynamic_pool.hh:75
void * allocate(size_t size)
Definition: dynamic_pool.hh:12
void reset(T *t)
Definition: dynamic_pool.hh:81
void deallocate(void *vbuffer)
boost::uint32_t size_t
Definition: dynamic_pool.hh:29
~dynamic_auto()
Definition: dynamic_pool.hh:69
T * release()
Definition: dynamic_pool.hh:89
Definition: dynamic_pool.hh:23
dynamic_auto(T *t)
Definition: dynamic_pool.hh:66