I'm trying to decide whether I have a memory leak, and would like to be sure I correctly understand the way the default Chibi heap works. As far as I can tell:
1. The value reported by chCoreGetStatus() is 'unassigned' memory which has never been used. It will therefore remain static, or decrease, over time - never increase.
2. The values reported by chHeapStatus() reflect the status of memory which has actually been assigned to the heap; the value 'total' reflecting free space.
Is this correct?
As a matter of interest, has anyone instrumented malloc() and free() to look at this kind of situation?
Heap management
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Heap management
Hi,
1) Correct, it is contiguous unallocated space.
2) Correct again, the heap starts empty and allocates from "core" when needed, it never returns blocks to "core".
Giovanni
1) Correct, it is contiguous unallocated space.
2) Correct again, the heap starts empty and allocates from "core" when needed, it never returns blocks to "core".
Giovanni