The structure used to return statistics about a heap or mpool.
typedef struct
{
DWORD blk_size; // basic allocation size
DWORD page_size; // round up to this
DWORD max_pool_size; // maximum pool size in bytes, 0 == no limit
DWORD pages_alloced; // current pages allocated
DWORD pages_highwater; // allocated pages high water mark
QWORD ttl_blk_alloc_ops; // ttl number of block allocation operations
QWORD ttl_blk_free_ops; // ttl number of block free operations
DWORD ttl_bytes_alloced; // total bytes in use via alloc ops
DWORD alloced_buffers; // number of buffers currently allocated
QWORD ttl_alloc_ops; // total number of alloc operations
QWORD ttl_free_ops; // total number of free operations
QWORD ttl_alloc_failures; // ttl number of allocs returning NULL
QWORD ttl_consolidations_fore; // ttl number of buffer consolidations on free with fore buffer
QWORD ttl_consolidations_back; // ttl number of buffer consolidations on free with back buffer
QWORD ttl_realloc_ops; // total realloc operations
QWORD ttl_realloc_expand; // ttl buffer expansions
QWORD ttl_realloc_contract; // ttl buffer contractions
QWORD ttl_realloc_expand_failures; // total failues to expand in place
QWORD ttl_realloc_contract_failures; // total failures to contract in place
QWORD ttl_realloc_alloc_failures; // failure of alloc
QWORD ttl_realloc_alloc_fallback; // can't do in place, fallback to alloc
DWORD ttl_data_blks; // total data blocks
DWORD ttl_free_blks; // total free blocks
DWORD ttl_free_frags; // total free fragments
DWORD free_blk_largest; // largest block on free list
DWORD free_blk_smallest; // smallest block on free list
DWORD free_frag_largest; // largest fragment on free list
DWORD free_frag_smallest; // smallest fragment on free list
DWORD data_blk_largest; // largest alloc block
DWORD data_blk_smallest; // smallest alloc block
DWORD alloced_largest; // largest allocated buffer
DWORD alloced_smallest; // smallest allocated buffer
// fragment free list - fragments not in use
DWORD ffl_bucket_huge; // fragments larger than 4k
DWORD ffl_bucket_4k; // 4K bucket
DWORD ffl_bucket_2k; // >= 2K bucket
DWORD ffl_bucket_1k; // >= 1K bucket
DWORD ffl_bucket_512; // >= 512 byte bucket
DWORD ffl_bucket_256; // >= 256 byte bucket
DWORD ffl_bucket_128; // >= 128 byte bucket
DWORD ffl_bucket_64; // >= 64 byte bucket
DWORD ffl_bucket_32; // >= 32 byte bucket
DWORD ffl_bucket_16; // >= 16 byte bucket
DWORD ffl_bucket_8; // >= 8 byte bucket
DWORD ffl_bucket_4; // >= 4 byte bucket
// fragment allocation list - fragments in use
DWORD fal_bucket_huge; // fragments larger than 4k
DWORD fal_bucket_4k; // 4K bucket
DWORD fal_bucket_2k; // >= 2K bucket
DWORD fal_bucket_1k; // >= 1K bucket
DWORD fal_bucket_512; // >= 512 byte bucket
DWORD fal_bucket_256; // >= 256 byte bucket
DWORD fal_bucket_128; // >= 128 byte bucket
DWORD fal_bucket_64; // >= 64 byte bucket
DWORD fal_bucket_32; // >= 32 byte bucket
DWORD fal_bucket_16; // >= 16 byte bucket
DWORD fal_bucket_8; // >= 8 byte bucket
DWORD fal_bucket_4; // > 4 byte bucket
DWORD fal_bucket_tiny; // tiny bucket
} MPOOL_STATS;
A call to heap_stats_reset/mpool_stats_reset clears the following fields:
ttl_alloc_failures ttl_alloc_ops ttl_blk_alloc_ops ttl_blk_free_ops ttl_consolidations_back ttl_consolidations_fore ttl_free_ops ttl_realloc_alloc_failures ttl_realloc_alloc_fallback ttl_realloc_contract ttl_realloc_contract_failures ttl_realloc_expand ttl_realloc_expand_failures ttl_realloc_ops
All other fields are calculated by a call to mpool_stats/heap_stats.
| Versions | Defined in | Include | Link to |
|---|---|---|---|
| INtime 3.13 | intime/rt/include/heap.h | rt.h | clib.lib |