Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: How to distinguish below three kinds of heap ?

$
0
0

Hi Ferdinand,

The BIOS module creates a default heap (system heap) for use by SYS/BIOS. "BIOS.heapSize" is a BIOS module config param that allows you to control the size of this default heap. You should not use "-heap" in the linker cmd file when building a BIOS application. If you want to change the system heap size, you should use BIOS.heapSize to do so.


Coming to question number 3 now. If you create your own heap instance like you showed above, it does not automatically become the system heap. If you want SYS/BIOS to use the heap instance you created as the system heap, you need to add something like this in your *.cfg file:

Memory.defaultHeapInstance = Program.global.myHeap; // where myHeap points to the HeapMem instance

I would recommend going through the "Dynamic Memory Allocation" section in the SYS/BIOS user guide (Section 6.7 in http://www.ti.com/lit/ug/spruex3m/spruex3m.pdf). It will cover everything I mentioned above and more in greater detail with examples.

Best,

Ashish


Viewing all articles
Browse latest Browse all 25965

Trending Articles