IOBufIovecBuilder exists to help allocate and fill IOBuf chains using iovec-based scatter/gather APIs.
Declared in <folly/io/IOBufIovecBuilder.h>
class IOBufIovecBuilder;
It provides APIs to allocate buffers for use with iovec-based system calls, and then construct IOBuf chains pointing to the buffer data that has been populated.
This class allows performing repeated vectored reads and minimizing the number of separate allocations if data is received in small chunks, while still generating unshared IOBuf instances. For instance, this helps support in place decryption mechanisms which require unshared IOBuf instances.
| Name | Description |
|---|---|
Options | Configuration options for an IOBufIovecBuilder. |
| Name | Description |
|---|---|
IoVecVec | A vector of iovec entries. |
| Name | Description |
|---|---|
IOBufIovecBuilder [constructor] | Constructors |
~IOBufIovecBuilder [destructor] | Releases the builder's references to its allocated buffers. |
operator= | Assignment operators |
allocateBuffers | Obtain a vector of writable blocks. This allocates memory in blocks of Options::blockSize_ bytes each. Unused memory from previous calls to allocateBuffers() will be re-used, and additional memory will be allocated if necessary. |
extractIOBufChain | Tell the queue that the caller has written data into the first n bytes provided by the previous allocateBuffers() call. |