00001 00021 #ifndef __MEM_H__ 00022 #define __MEM_H__ 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00031 00032 typedef struct Mem_Fixed_t_ Mem_Fixed_t; 00033 typedef struct Mem_Flex_t_ Mem_Flex_t; 00034 typedef struct Mem_Step_t_ Mem_Step_t; 00035 00039 00040 /*=== mem.c ===========================================================*/ 00041 // fixed-size-block memory manager 00042 extern Mem_Fixed_t * Mem_FixedStart( int nEntrySize ); 00043 extern void Mem_FixedStop( Mem_Fixed_t * p, int fVerbose ); 00044 extern char * Mem_FixedEntryFetch( Mem_Fixed_t * p ); 00045 extern void Mem_FixedEntryRecycle( Mem_Fixed_t * p, char * pEntry ); 00046 extern void Mem_FixedRestart( Mem_Fixed_t * p ); 00047 extern int Mem_FixedReadMemUsage( Mem_Fixed_t * p ); 00048 extern int Mem_FixedReadMaxEntriesUsed( Mem_Fixed_t * p ); 00049 // flexible-size-block memory manager 00050 extern Mem_Flex_t * Mem_FlexStart(); 00051 extern void Mem_FlexStop( Mem_Flex_t * p, int fVerbose ); 00052 extern char * Mem_FlexEntryFetch( Mem_Flex_t * p, int nBytes ); 00053 extern void Mem_FlexRestart( Mem_Flex_t * p ); 00054 extern int Mem_FlexReadMemUsage( Mem_Flex_t * p ); 00055 // hierarchical memory manager 00056 extern Mem_Step_t * Mem_StepStart( int nSteps ); 00057 extern void Mem_StepStop( Mem_Step_t * p, int fVerbose ); 00058 extern char * Mem_StepEntryFetch( Mem_Step_t * p, int nBytes ); 00059 extern void Mem_StepEntryRecycle( Mem_Step_t * p, char * pEntry, int nBytes ); 00060 extern int Mem_StepReadMemUsage( Mem_Step_t * p ); 00061 00062 #ifdef __cplusplus 00063 } 00064 #endif 00065 00066 #endif 00067 00071 00072