#include <XrdOucBuffer.hh>
These classes allow for buffer management to minimize data copying. They are typically used in conjunction with the XrdOucErrInfo class. The XrdOucBuffPool class defines a pool of buffers and one such object must exist for each buffer pool (there can be many such pools). This object manufactures XrdOucBuffer objects. You can also create XrdOucBuffers without using a buffer pool (i.e. one time buffers). See the XrdOucBuffer constructor for details on how to do this and the associated caveats.
◆ XrdOucBuffPool()
XrdOucBuffPool::XrdOucBuffPool |
( |
int |
minsz = 4096 , |
|
|
int |
maxsz = 65536 , |
|
|
int |
minh = 1 , |
|
|
int |
maxh = 16 , |
|
|
int |
rate = 1 |
|
) |
| |
Constructor
- Parameters
-
minsz | - the minimum size a buffer can have. If it is smaller than 1024 it is set to 1024. The minsz is also adjusted to be equal to the closest smaller value of 1024*(2**n) (i.e. 1K, 2k, 4K, etc). If it's greater than 16MB, it is set to 16MB. |
maxsz | - the maximum size a buffer can have and must be >= minsz. If it's >minsz it is rounded up to the next minsz increment. Buffer sizes are always allocated in minsz increments. |
minh | - the minimum number of buffers that should be held in reserve when a buffer is recycled. |
maxh | - the maximum number of buffers that should be held in reserve when a buffer is recycled. The value applies to the smallest buffer size and is progessively reduced as the buffer size increases. If maxh < minh it is set to minh. |
rate | - specifies how quickly the hold vale is to be reduced as buffer sizes increase. A rate of 0 specifies a purely linear decrease. Higher values logrithmically decrease the hold. |
◆ ~XrdOucBuffPool()
XrdOucBuffPool::~XrdOucBuffPool |
( |
| ) |
|
|
inline |
Destructor - You must not destroy this object prior to recycling all oustanding buffers allocated out of this pool.
References bSlot.
◆ Alloc()
Allocate a buffer object.
- Parameters
-
sz | - the desired size. It os rounded up to be a multiple of incBsz but cannot exceed maxBsz. |
- Returns
- !0 - pointer to usable buffer object of suitable size.
-
=0 - insufficient memort ro allocate a buffer.
◆ MaxSize()
int XrdOucBuffPool::MaxSize |
( |
| ) |
const |
|
inline |
Obtain the maximum size a buffer can have.
- Returns
- The maximum size a buffer can be.
References maxBsz.
◆ XrdOucBuffer
◆ alignit
int XrdOucBuffPool::alignit |
|
staticprivate |
◆ bSlot
◆ incBsz
int XrdOucBuffPool::incBsz |
|
private |
◆ maxBsz
int XrdOucBuffPool::maxBsz |
|
private |
◆ rndBsz
int XrdOucBuffPool::rndBsz |
|
private |
◆ shfBsz
int XrdOucBuffPool::shfBsz |
|
private |
◆ slots
int XrdOucBuffPool::slots |
|
private |
The documentation for this class was generated from the following file: