EPANET头文件解读系列7——MEMPOOL.H

//EPANET应用程序使用了大量的节点与管段数据,而且每个对象数据又有不同时段的数据,这些数据占用了大量内存,而mempool.h就是一个简单快速的内存分配相关的头文件
/*
**  mempool.h
**
**  Header for mempool.c
**
**  The type alloc_handle_t provides an opaque reference to the
**  alloc pool - only the alloc routines know its structure.
*/

typedef struct
{
   long  dummy;
}  alloc_handle_t;

alloc_handle_t *AllocInit(void);                   //create an alloc pool, returns the old pool handle
char           *Alloc(long);                       //allocate memory
alloc_handle_t *AllocSetPool(alloc_handle_t *);    //reset the current pool
void            AllocReset(void);                  //set the current pool
void            AllocFreePool(void);               //free the memory used by the current pool.

posted @ 2013-09-10 11:36  KingOfFreedom  阅读(393)  评论(0编辑  收藏  举报