sipxmedialib
Version 3.3
|
Pool of buffers. More...
#include <MpBufPool.h>
Public Member Functions | |
Creators | |
MpBufPool (unsigned blockSize, unsigned numBlocks, const UtlString &poolName) | |
Creates pool with numBlocks in it. Each block have size blockSize. More... | |
virtual | ~MpBufPool () |
Destroys pool. More... | |
Manipulators | |
MpBuf * | getBuffer () |
Get free block from pool. More... | |
void | releaseBuffer (MpBuf *pBuffer) |
Bring this buffer back to pool. More... | |
Accessors | |
unsigned | getBlockSize () const |
Return size of the one block in the pool (in bytes). More... | |
unsigned | getNumBlocks () const |
Return number of blocks in the pool. More... | |
int | getBufferNumber (MpBuf *pBuf) const |
Return number of the buffer in the pool. Use this for debug output. More... | |
int | getFreeBufferCount () |
Return the number of free buffers. More... | |
int | scanBufPool (MpFlowGraphBase *pFG) |
Scan for orphan buffers. More... | |
int | profileFlowgraphPoolUsage () |
Syslog a histigram of buffers used by flowgraph. More... | |
const UtlString & | getName () |
Get the name label for this pool. More... | |
Protected Member Functions | |
void * | getPoolDataEnd () |
Return pointer to the byte after end of the pool data. More... | |
char * | getNextBlock (char *pBlock) |
Return pointer to the block, next to this. More... | |
void | appendFreeList (MpBuf *pBuf) |
Protected Attributes | |
UtlString | mPoolName |
label or name for debug More... | |
unsigned | mBlockSize |
Requested size of each block in pool (in bytes). More... | |
unsigned | mBlockSpan |
Actual size of each block. >= mBlockSize for alignment. More... | |
unsigned | mNumBlocks |
Number of blocks in pool. More... | |
unsigned | mPoolBytes |
Size of all pool in bytes. More... | |
char * | mpPoolData |
MpBufList * | mpFreeList |
OsMutex | mMutex |
Mutex to avoid concurrent access to the pool. More... | |
Private Attributes | |
unsigned | mNumGets |
unsigned | mNumFrees |
For statistics. More... | |
unsigned | mNumFree |
For statistics. More... | |
unsigned | mMinFree |
For statistics. More... | |
Pool of buffers.
MpBufPool | ( | unsigned | blockSize, |
unsigned | numBlocks, | ||
const UtlString & | poolName | ||
) |
Creates pool with numBlocks in it. Each block have size blockSize.
|
virtual |
Destroys pool.
MpBuf * getBuffer | ( | ) |
Get free block from pool.
void releaseBuffer | ( | MpBuf * | pBuffer | ) |
Bring this buffer back to pool.
|
inline |
Return size of the one block in the pool (in bytes).
|
inline |
Return number of blocks in the pool.
int getBufferNumber | ( | MpBuf * | pBuf | ) | const |
Return number of the buffer in the pool. Use this for debug output.
int getFreeBufferCount | ( | ) |
Return the number of free buffers.
int scanBufPool | ( | MpFlowGraphBase * | pFG | ) |
Scan for orphan buffers.
int profileFlowgraphPoolUsage | ( | ) |
Syslog a histigram of buffers used by flowgraph.
const UtlString & getName | ( | ) |
Get the name label for this pool.
|
inlineprotected |
Return pointer to the byte after end of the pool data.
|
inlineprotected |
Return pointer to the block, next to this.
|
protected |
|
protected |
label or name for debug
|
protected |
Requested size of each block in pool (in bytes).
|
protected |
Actual size of each block. >= mBlockSize for alignment.
|
protected |
Number of blocks in pool.
|
protected |
Size of all pool in bytes.
|
protected |
Pointer to allocated memory. May be padded to match align rules.
|
protected |
Begin of the free blocks list. NULL if there are no free blocks availiable.
|
protected |
Mutex to avoid concurrent access to the pool.
|
private |
|
private |
For statistics.
|
private |
For statistics.
|
private |
For statistics.