Heap and workspace memory.

Joel Sherrill joel.sherrill at OARcorp.com
Wed Oct 11 18:00:28 UTC 2000



William Halliburton wrote:
> 
>         The FAQ gives a method of determining the workspace and heap with gdb. Is
> there an easy way from C?

There is not a function to do this at the moment.  It would be
relatively 
simple to write this function based on the code in _Heap_Walk.  It could
easily calculate items like number free/used blocks, bytes,
minimum/max/avg
of used/free blocks.

The heap code is in c/src/exec/score/src.  _Heap_Walk already loops over 
an entire heap. ALternatively, the _Heap_ALlocate routine also walks
over the heap looking for the first free block of sufficient size. It
might be a good starting point as well.

>         Thank you,
>         William

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list