16 #define P6MEMPOOL_H__ 1
25 #define MEMPOOL_FREE_VALUE 0xdd
26 #define P6MEMPOOL_NAME_MAX 32
65 #define INTERFACE p6IMemPool
203 #define IF_p6IMemPool {0x3FE25F49,0x9400,0x4aec,{0x9D,0x8C,0xE8,0x37,0x47,0xC1,0x0F,0x6C}}
206 #define COMP_p6MemPool {0xD521E1E5,0x5A61,0x47c0,{0x93,0x1A,0x00,0x3A,0xF5,0xD6,0x13,0xA0}}
217 {
if(NULL != m_pPool) m_pPool->
release(); m_pPool = NULL; }
224 err = m_pPool->
initialize(nFlags,
sizeof(T),uiInitial,uiGrowby,pszName);
229 {
if(m_pPool)
return m_pPool->
alloc((
void**)ppMem);
else return eNotInitialized; }
231 {
if(m_pPool)
return m_pPool->
free((
void*)pMem);
else return eNotInitialized; }
233 {
if(m_pPool)
return m_pPool->
getStats(pcBlock,pcActual,pcInitial,pcGrowby,pcTotal,pcFree,pcHighWater);
else return eNotInitialized; }
#define P6DECLARE_CID(component)
Defines a component identifier.
const MEMPOOLFLGS MEMPOOL_NOLOCKS
Disable serialization.
P6R::P6ERR alloc(T **ppMem)
virtual P6R::P6ERR alloc(P6VOID **ppMem)=0
Allocates am allocation unit from the memory pool.
#define P6DECLARE_IID(iface)
Defines a Interface Identifier.
P6R::P6ERR initialize(MEMPOOLFLGS nFlags, P6R::P6UINT32 uiInitial, P6R::P6UINT32 uiGrowby, const P6R::P6WCHAR *pszName)
#define VALIDATEIF(type, ptr)
std::nothrow
virtual P6INT32 release(void)=0
This method decrements a components reference count.
const MEMPOOLFLGS MEMPOOL_NOFLAGS
wchar_t P6WCHAR
Wide character type see p6i18n.h.
The base interface all [p6]COM components must derive from and implement.
P6API P6ERR P6CCALL p6CreateInstance(p6ICom *pOuter, const P6R::P6CID &cid, const P6R::P6IID &iid, P6VOID **ppIface)
Creates a single uninitialized instance of the class/interface associated with the specified componen...
P6R::P6ERR getStats(P6R::P6UINT32 *pcBlock, P6R::P6UINT32 *pcActual, P6R::P6UINT32 *pcInitial, P6R::P6UINT32 *pcGrowby, P6R::P6UINT32 *pcTotal, P6R::P6UINT32 *pcFree, P6R::P6UINT32 *pcHighWater)
virtual P6R::P6ERR free(P6VOID *pMem)=0
Returns an allocation back to the pool and makes it available to be allocated via alloc()...
const MEMPOOLFLGS MEMPOOL_USEHEAP
Pooling disabled, allocs are done from heap directly, also disables serialization within the memory p...
This is a fixed size memory allocator.
P6UINT32 P6ERR
COM err return type see P6ERR.h.
#define P6DECLCOMMETHOD(method)
virtual P6R::P6ERR initialize(MEMPOOLFLGS nFlags, P6UINT32 cPageSize, P6UINT32 cInitialCount, P6UINT32 cGrowBy, const P6WCHAR *pszName)=0
This method is called to initialize the memory pool for use.
const MEMPOOLFLGS MEMPOOL_ZEROMEM
Alloc() returns zero'd memory.
const MEMPOOLFLGS MEMPOOL_ENABLEFENCES
Enable under/overrun detection.
P6COM definitions and interfaces.
const MEMPOOLFLGS MEMPOOL_SETFREEMEM
Set free blocks to MEMPOOL_FREE_VALUE for debugging.
virtual P6R::P6ERR getStats(P6UINT32 *pcBlock, P6UINT32 *pcActual, P6UINT32 *pcInitial, P6UINT32 *pcGrowby, P6UINT32 *pcTotal, P6UINT32 *pcFree, P6UINT32 *pcHighWater)=0
Retrieves current statistical information for the memory pool.
#define P6DECLAREIF_(iface, baseif)