Memory usage statistics for heap and pools.

This commit is contained in:
Ruben Ayrapetyan
2014-07-09 14:59:27 +04:00
parent d25d33cd58
commit aaf3d76cae
7 changed files with 552 additions and 166 deletions
+25
View File
@@ -71,6 +71,31 @@ extern void mem_PoolsInit(void);
extern uint8_t* mem_PoolsAlloc(mem_PoolChunkType_t chunkType);
extern void mem_PoolsFree(mem_PoolChunkType_t chunkType, uint8_t *pChunk);
#ifdef MEM_STATS
/**
* Pools' memory usage statistics
*/
typedef struct
{
/** pools' count, per type */
size_t pools_count[ MEM_POOL_CHUNK_TYPE__COUNT ];
/** peak pools' count, per type */
size_t peak_pools_count[ MEM_POOL_CHUNK_TYPE__COUNT ];
/** allocated chunks count, per type */
size_t allocated_chunks[ MEM_POOL_CHUNK_TYPE__COUNT ];
/** peak allocated chunks count, per type */
size_t peak_allocated_chunks[ MEM_POOL_CHUNK_TYPE__COUNT ];
/** free chunks count, per type */
size_t free_chunks[ MEM_POOL_CHUNK_TYPE__COUNT ];
} mem_PoolsStats_t;
extern void mem_PoolsGetStats( mem_PoolsStats_t *out_pools_stats_p);
#endif /* MEM_STATS */
#endif /* JERRY_MEM_POOLMAN_H */
/**