flMemoryPool.h

Go to the documentation of this file.
00001 // Funclib Memory Pool v1.0.0
00002 // 
00003 // This module contains functions for memory pooling.
00004 // 
00005 // Contributor(s): Flatmush.
00006 
00007 
00008 
00009 #ifndef FLMEMORYPOOL_H
00010 #define FLMEMORYPOOL_H
00011 
00012 #include "flGlobal.h"
00013 #include "flMemory.h"
00014 #include "flMemoryVMem.h"
00015 
00016 #define MEMORY_POOL_TYPE_NONE     0
00017 #define MEMORY_POOL_TYPE_TABLE    1
00018 #define MEMORY_POOL_TYPE_LINKLIST 2
00019 
00020 #if FL_MEMORY_POOL != 0
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 typedef struct {
00027      void* mempData;
00028      u32   mempSize;
00029      u32   mempType;
00030      void* mempAllocData;
00031 } MemoryPool;
00032 
00033 typedef struct {
00034      void* mempHLLData;
00035      u32   mempHLLSize;
00036      void* mempHLLNext;
00037      void* mempHLLPrev;
00038 } MemoryPoolHdrLL;
00039 
00040 extern MemoryPool* mempCreate(u32 inSize, u32 inType);
00041 extern void        mempDestroy(MemoryPool* inMemPool);
00042 
00043 extern void*       mempAlloc(MemoryPool* inMemPool, u32 inSize);
00044 extern void*       mempCalloc(MemoryPool* inMemPool, u32 inSize0, u32 inSize1);
00045 extern void*       mempRealloc(MemoryPool* inMemPool, void* inPtr, u32 inSize);
00046 extern void*       mempAlign(MemoryPool* inMemPool, u32 inBoundry, u32 inSize);
00047 extern void        mempFree(MemoryPool* inMemPool, void* inPtr);
00048 
00049 #ifdef __cplusplus
00050 }
00051 #endif
00052 
00053 #endif
00054 
00055 #endif

Generated on Wed Sep 5 19:04:00 2007 for funcLib by  doxygen 1.5.1