#include <static_mem_pool.h>
Definition at line 80 of file static_mem_pool.h.
Public Types | |
| typedef class_level_lock < static_mem_pool_set >::lock | lock |
Public Member Functions | |
| void | add (mem_pool_base *__memory_pool_p) |
| void | recycle () |
Static Public Member Functions | |
| static static_mem_pool_set & | instance () |
Data Fields | |
| __PRIVATE | __pad0__: ~static_mem_pool_set() |
Private Types | |
| typedef std::vector < mem_pool_base * > | container_type |
Private Member Functions | |
| const static_mem_pool_set & | operator= (const static_mem_pool_set &) |
| static_mem_pool_set (const static_mem_pool_set &) | |
| static_mem_pool_set () | |
Private Attributes | |
| container_type | _M_memory_pool_set |
typedef std::vector<mem_pool_base*> static_mem_pool_set::container_type [private] |
Definition at line 93 of file static_mem_pool.h.
Definition at line 83 of file static_mem_pool.h.
| static_mem_pool_set::static_mem_pool_set | ( | ) | [private] |
Definition at line 43 of file static_mem_pool.cpp.
References _STATIC_MEM_POOL_TRACE.
00044 { 00045 _STATIC_MEM_POOL_TRACE(false, "The static_mem_pool_set is created"); 00046 }
| static_mem_pool_set::static_mem_pool_set | ( | const static_mem_pool_set & | ) | [private] |
| void static_mem_pool_set::add | ( | mem_pool_base * | __memory_pool_p | ) |
Adds a new memory pool to static_mem_pool_set.
| __memory_pool_p | pointer to the memory pool to add |
Definition at line 90 of file static_mem_pool.cpp.
References _M_memory_pool_set.
Referenced by static_mem_pool< _Sz, _Gid >::_S_create_instance().
00091 { 00092 lock __guard; 00093 _M_memory_pool_set.push_back(__memory_pool_p); 00094 }
| static_mem_pool_set & static_mem_pool_set::instance | ( | ) | [static] |
Creates the singleton instance of static_mem_pool_set.
Definition at line 61 of file static_mem_pool.cpp.
Referenced by static_mem_pool< _Sz, _Gid >::_S_alloc_sys(), and static_mem_pool< _Sz, _Gid >::_S_create_instance().
00062 { 00063 lock __guard; 00064 static static_mem_pool_set _S_instance; 00065 return _S_instance; 00066 }
| const static_mem_pool_set& static_mem_pool_set::operator= | ( | const static_mem_pool_set & | ) | [private] |
| void static_mem_pool_set::recycle | ( | ) |
Asks all static memory pools to recycle unused memory blocks back to the system. The caller should get the lock to prevent other operations to static_mem_pool_set during its execution.
Definition at line 73 of file static_mem_pool.cpp.
References _M_memory_pool_set, and _STATIC_MEM_POOL_TRACE.
Referenced by static_mem_pool< _Sz, _Gid >::_S_alloc_sys().
00074 { 00075 _STATIC_MEM_POOL_TRACE(false, "Memory pools are being recycled"); 00076 container_type::iterator __end = _M_memory_pool_set.end(); 00077 for (container_type::iterator 00078 __i = _M_memory_pool_set.begin(); 00079 __i != __end; ++__i) 00080 { 00081 (*__i)->recycle(); 00082 } 00083 }
| __PRIVATE static_mem_pool_set::__pad0__ |
Definition at line 89 of file static_mem_pool.h.
1.5.6