Champs, so I am 'switching forums' on a question I had originally posted to the LPRF Forum for CC26xx, but really was more of a SYSBIOS question.
What I am trying to do is find an easy way to monitor the heap usage of the SYSBIOS heap during runtime- basically I want to be able to print out the amount of available heap during runtime. The problem I intrinsically have is that NORMALLY I would do this with a HeapMem_GetStats call if I had created the heap; and I could pass in a handle to the heap that got assigned when I created it. The problem is; the SYSBIOS heap isn't created that way; it seems to automagically get created using an RTOS config file (it's really a RTSC config file, right?); with this syntax:
From the appBLE.cfg RTOS config file:
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
Okay, so whats the handle of the HeapMem variable? That is, normally, I would have used something like HeapMem_getStats- which would be fine, except the prototype for that call is:
HeapMem_getStats((HeapMem_Handle)heapMemStruct, *xdc_runtime_Memory_Stats);
but I have no idea what heapMemStruct is (and neither does the compiler!!!). A colleague from the LPRF group had cited this as a possible option:
#include <xdc/runtime/Memory.h>
extern
const
IHeap_Handle Memory_defaultHeapInstance;
Memory_Stats stats;
Memory_getStats(Memory_defaultHeapInstance, &stats);