|
|||||||||||
|
Technical Support On-Line Manuals C and C++ Libraries and Floating-Point Support Reference |
__heapstats()
Defined in Example 1 shows an
example of the output from Example 1. Output from __heapstats() 32272 bytes in 2 free blocks (avge size 16136) 1 blocks 2^12+1 to 2^13 1 blocks 2^13+1 to 2^14 Line 1 of the output displays the total number of bytes, the
number of free blocks, and the average size. The following lines
give an estimate of the size of each block in bytes, expressed as
a range. The function outputs its results by calling the output function __heapstats((__heapprt)fprintf, stderr); NoteIf you call If you are using the default one-region memory model, heap memory is allocated only as it is required. This means that the amount of free heap changes as you allocate and deallocate memory. For example, the sequence: int *ip; __heapstats((__heapprt)fprintf,stderr); // print initial free heap size ip = malloc(200000); free(ip); __heapstats((__heapprt)fprintf,stderr); // print heap size after freeing gives output such as: 4076 bytes in 1 free blocks (avge size 4076) 1 blocks 2^10+1 to 2^11 2008180 bytes in 1 free blocks (avge size 2008180) 1 blocks 2^19+1 to 2^20 This function is not part of the C library standard, but is supported by the ARM C library as an extension. | ||||||||||
|
|||||||||||