A global pool of Buffers. More...
#include "config.h"
#include <stdio.h>
#include "pool.h"
#include "buffer.h"
#include "logging2.h"
#include "memory.h"
#include "signal2.h"
Go to the source code of this file.
Functions | |
static void | pool_increase_size (void) |
Increase the size of the Buffer pool. | |
void | buf_pool_cleanup (void) |
Release the Buffer pool. | |
struct Buffer * | buf_pool_get (void) |
Get a Buffer from the pool. | |
void | buf_pool_release (struct Buffer **ptr) |
Return a Buffer to the pool. | |
Variables | |
static size_t | BufferPoolCount = 0 |
Number of buffers in the pool. | |
static size_t | BufferPoolLen = 0 |
Total size of the pool. | |
static const size_t | BufferPoolIncrement = 20 |
Amount to increase the size of the pool. | |
static const size_t | BufferPoolInitialBufferSize = 1024 |
Minimum size for a buffer. | |
static struct Buffer ** | BufferPool = NULL |
A pool of buffers. | |
A global pool of Buffers.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file pool.c.
|
static |
Increase the size of the Buffer pool.
Definition at line 51 of file pool.c.
void buf_pool_cleanup | ( | void | ) |
Release the Buffer pool.
Definition at line 68 of file pool.c.
struct Buffer * buf_pool_get | ( | void | ) |
void buf_pool_release | ( | struct Buffer ** | ptr | ) |
Return a Buffer to the pool.
[out] | ptr | Buffer to release |
Definition at line 96 of file pool.c.
|
static |
|
static |
|
static |