Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

mempool.h File Reference

#include "sf_sdlist.h"

Go to the source code of this file.

Typedefs

typedef unsigned int PoolCount
typedef _MemBucket MemBucket
typedef _MemPool MemPool

Functions

int mempool_init (MemPool *mempool, PoolCount num_objects, size_t obj_size)
int mempool_destroy (MemPool *mempool)
MemBucketmempool_alloc (MemPool *mempool)
void mempool_free (MemPool *mempool, MemBucket *obj)


Typedef Documentation

typedef struct _MemBucket MemBucket
 

typedef struct _MemPool MemPool
 

typedef unsigned int PoolCount
 

Definition at line 26 of file mempool.h.


Function Documentation

MemBucket* mempool_alloc MemPool mempool  ) 
 

Definition at line 195 of file mempool.c.

References bzero, _MemBucket::data, _SDListItem::data, _MemPool::free, _MemPool::free_list, sfSDList::head, NULL, _MemPool::obj_size, sf_sdlist_append(), sf_sdlist_remove(), _MemPool::used, and _MemPool::used_list.

Referenced by AddPortScanner(), AddTarget(), ConvAlloc(), and ConvGetSession().

int mempool_destroy MemPool mempool  ) 
 

Definition at line 174 of file mempool.c.

References bzero, _MemPool::listpool, and NULL.

void mempool_free MemPool mempool,
MemBucket obj
 

Definition at line 240 of file mempool.c.

References _MemPool::free, _MemPool::free_list, _MemBucket::key, sf_sdlist_append(), sf_sdlist_remove(), _MemPool::used, and _MemPool::used_list.

Referenced by ConvDelete(), DeletePortscanner(), and DeleteTarget().

int mempool_init MemPool mempool,
PoolCount  num_objects,
size_t  obj_size
 

Definition at line 53 of file mempool.c.

References _MemPool::bucketpool, _MemBucket::data, _MemPool::datapool, _MemPool::free, _MemPool::free_list, _MemBucket::key, _MemPool::listpool, NULL, _MemPool::obj_size, sf_sdlist_append(), sf_sdlist_init(), _MemPool::total, _MemPool::used, and _MemPool::used_list.

Referenced by ConvInit(), and Scan2Init().


Generated on Sun May 14 14:51:23 2006 by  doxygen 1.4.2