[Bug 1367] Malloc statistics wrong in R4.10
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Wed Apr 11 08:20:47 UTC 2012
https://www.rtems.org/bugzilla/show_bug.cgi?id=1367
--- Comment #6 from Sebastian Huber <sebastian.huber at embedded-brains.de> 2012-04-11 03:20:47 CDT ---
Currently we have two statistics. The one from the heap implementation:
typedef struct {
/**
* @brief Instance number of this heap.
*/
uint32_t instance;
/**
* @brief Size of the allocatable area in bytes.
*
* This value is an integral multiple of the page size.
*/
uintptr_t size;
/**
* @brief Current free size in bytes.
*
* This value is an integral multiple of the page size.
*/
uintptr_t free_size;
/**
* @brief Minimum free size ever in bytes.
*
* This value is an integral multiple of the page size.
*/
uintptr_t min_free_size;
/**
* @brief Current number of free blocks.
*/
uint32_t free_blocks;
/**
* @brief Maximum number of free blocks ever.
*/
uint32_t max_free_blocks;
/**
* @brief Current number of used blocks.
*/
uint32_t used_blocks;
/**
* @brief Maximum number of blocks searched ever.
*/
uint32_t max_search;
/**
* @brief Total number of successful allocations.
*/
uint32_t allocs;
/**
* @brief Total number of searches ever.
*/
uint32_t searches;
/**
* @brief Total number of suceessful calls to free.
*/
uint32_t frees;
/**
* @brief Total number of successful resizes.
*/
uint32_t resizes;
} Heap_Statistics;
And the one from malloc:
typedef struct {
uint32_t space_available; /* current size of malloc area */
uint32_t malloc_calls; /* # calls to malloc */
uint32_t memalign_calls; /* # calls to memalign */
uint32_t free_calls;
uint32_t realloc_calls;
uint32_t calloc_calls;
uint32_t max_depth; /* most ever malloc'd at 1 time */
uintmax_t lifetime_allocated;
uintmax_t lifetime_freed;
} rtems_malloc_statistics_t;
I would like to remove the special case malloc() statistics and use the heap
statistics instead. This makes the CONFIGURE_MALLOC_STATISTICS option
obsolete.
The malloc() statistics currently have a max_depth, lifetime_allocated, and
lifetime_freed field. Should we add this to the heap statistics?
--
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the bugs
mailing list