- #ifndef __AVIT_OC_GEN_H__
- #define __AVIT_OC_GEN_H__
- #ifdef _MSC_VER
- #include "wtypes.h"
- #include "stdio.h"
- #endif
- #include "j_gendef.h"
- #include "avit_oc_config.h"
- #endif /* __AVIT_OC_GEN_H__ */
- #ifndef __AVIT_MEMORY_POOL_H__
- #define __AVIT_MEMORY_POOL_H__
- #include "avit_oc_gen.h"
- #include "j_osp.h"
- #include "string.h"
- #if defined(__cplusplus)
- extern "C" {
- #endif
- #ifdef _MSC_VER
- #pragma pack(4)
- #endif
- typedef struct _MemNode
- {
- BOOL used;
- UINT32 size;
- UINT8* addr;
- struct _MemNode* last;
- struct _MemNode* next;
- }MemNode;
- #ifdef _MSC_VER
- #pragma pack()
- #endif
- INT32 memory_pool_init();
- void memory_pool_clear();
- void memory_pool_release();
- void* memory_pool_malloc(UINT32 size);
- void memory_pool_free(void* pAddr);
- UINT32 memory_pool_get_peak_use();
- UINT32 memory_pool_get_now_use();
- UINT32 memory_pool_get_available_size();
- void memory_pool_dump();
- #if defined(__cplusplus)
- }
- #endif
- #endif /* __AVIT_MEMORY_POOL_H__ */
- #ifndef __AVIT_OC_CONFIG_H__
- #define __AVIT_OC_CONFIG_H__
- #define SIZE_K 1024
- #define SIZE_M (1024*1024)
- #define PRINT_ENABLE 1
- #define CACHE_SIZE (1*SIZE_M)
- #define CACHE_RESERVED (256*SIZE_K)
- #define CACHE_DEAL (CACHE_SIZE*2+CACHE_RESERVED)
- #define MEMORY_POOL_ENABLE 1
- #define MEMORY_POOL_COUNTER_ENABLE 1
- #define MEMORY_POOL_SIZE_MIN (2*SIZE_M)
- #define MEMORY_POOL_SIZE ( (CACHE_DEAL < MEMORY_POOL_SIZE_MIN) ? MEMORY_POOL_SIZE_MIN:CACHE_DEAL )
- #endif /* __AVIT_OC_CONFIG_H__ */