This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28379D: Get the current heap usage in program

Part Number: TMS320F28379D


Tool/software: TI C/C++ Compiler

I use dynamic memory allocation, but not dynamically. I create some "objects" via calloc, and after some point, nothing else will be put in the heap. At that point I would like to know how much memory was used from the heap section, just to verify that I do not have a memory problem.

Once put in the heap, objects are never de-referenced, i.e., "free".

Question: Is it possible to get the current heap usage from within the program?

I was thinking about putting a dummy object in the heap and reading its address afterwards, but was hoping for a more elegant solution. If there is no elegant solution, would this work?