mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Add heap used/free summaries to heap dump
This commit is contained in:
parent
89037cc83a
commit
56b3b46f75
@ -27,6 +27,8 @@ end
|
||||
|
||||
define _showheap
|
||||
set $index = $arg0
|
||||
set $used = 0
|
||||
set $free = 0
|
||||
if (sizeof(struct mm_allocnode_s) == 4)
|
||||
set $MM_ALLOC_BIT = 0x8000
|
||||
else
|
||||
@ -41,6 +43,9 @@ define _showheap
|
||||
printf " %u", $nodestruct->size
|
||||
if !($nodestruct->preceding & $MM_ALLOC_BIT)
|
||||
printf " FREE"
|
||||
set $free = $free + $nodestruct->size
|
||||
else
|
||||
set $used = $used + $nodestruct->size
|
||||
end
|
||||
if ($nodestruct->size > g_heapsize) || (($node + $nodestruct->size) > g_heapend[$index])
|
||||
printf " (BAD SIZE)"
|
||||
@ -48,6 +53,9 @@ define _showheap
|
||||
printf "\n"
|
||||
set $node = $node + $nodestruct->size
|
||||
end
|
||||
printf " ----------\n"
|
||||
printf " Used: %u\n", $used
|
||||
printf " Free: %u\n\n", $free
|
||||
end
|
||||
|
||||
define showheap
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user