A global pool of Buffers. More...
#include "config.h"
#include <stdio.h>
#include "pool.h"
#include "buffer.h"
#include "logging.h"
#include "memory.h"
Go to the source code of this file.
Functions | |
static struct Buffer * | buffer_new (void) |
Allocate a new Buffer on the heap. More... | |
static void | buffer_free (struct Buffer **p) |
Release a Buffer and its contents. More... | |
static void | increase_buffer_pool (void) |
Increase the size of the Buffer pool. More... | |
void | mutt_buffer_pool_free (void) |
Release the Buffer pool. More... | |
struct Buffer * | mutt_buffer_pool_get (void) |
Get a Buffer from the pool. More... | |
void | mutt_buffer_pool_release (struct Buffer **pbuf) |
Free a Buffer from the pool. More... | |
Variables | |
static size_t | BufferPoolCount = 0 |
static size_t | BufferPoolLen = 0 |
static size_t | BufferPoolIncrement = 20 |
static size_t | BufferPoolInitialBufferSize = 1024 |
static struct Buffer ** | BufferPool = NULL |
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 |
Allocate a new Buffer on the heap.
buf | A newly allocated Buffer |
Definition at line 47 of file pool.c.
|
static |
Release a Buffer and its contents.
[out] | p | Buffer pointer to free and NULL |
Definition at line 58 of file pool.c.
|
static |
Increase the size of the Buffer pool.
Definition at line 70 of file pool.c.
void mutt_buffer_pool_free | ( | void | ) |
struct Buffer* mutt_buffer_pool_get | ( | void | ) |
void mutt_buffer_pool_release | ( | struct Buffer ** | pbuf | ) |
Free a Buffer from the pool.
[out] | pbuf | Buffer to free |
Definition at line 112 of file pool.c.