src/tools.c File Reference

#include <stdlib.h>
#include "mb_tools.h"

Go to the source code of this file.

Classes

struct  _elmpool
 Small fixed size data elements management. More...

Functions

elmpool_telmpool_new (int elm_sz, int inc_num)
 Create a new data elements pool.
void * elmpool_elm_alloc (elmpool_t *pool)
void elmpool_elm_free (elmpool_t *pool, void *elm)
void elmpool_free (elmpool_t *pool)


Function Documentation

void* elmpool_elm_alloc ( elmpool_t pool  ) 

Definition at line 65 of file tools.c.

void elmpool_elm_free ( elmpool_t pool,
void *  elm 
)

Definition at line 95 of file tools.c.

void elmpool_free ( elmpool_t pool  ) 

Definition at line 100 of file tools.c.

elmpool_t* elmpool_new ( int  elm_sz,
int  inc_num 
)

Create a new data elements pool.

elmpool_t provide a pool of fixed size elements to gain better utilization of memory. It try to allocate bigger memory blocks for multiple elements.

Parameters:
elm_sz size of elements.
inc_num is number of elments to allocate every time. (>= 16)
Returns:
A elmpool or NULL for error.

Definition at line 39 of file tools.c.

SourceForge.net Logo