Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Heap Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
HeapPrograms linked with a run-time system need a heap. Locate parameter Name is ignored. If parameter Size is not specified or 0, RTLoc will assign all unused memory of the region to the heap after all other entities have been located. If stack and heap are located in the same region, at least one of the two must specify a size. The default value for parameter Access is NoAccess. The heap manager must explicitly change page attributes at run time to make the memory accessible. This prevents the application from accessing heap memory before it has been allocated using malloc, new, or a similar function. However, this requires the page table to be located in RAM. If you plan to locate the page table in ROM, ReadWrite access must be specified for the Heap. In addition, each program that will run under another program's control (i.e., the program is referenced with a Reserve command by another program), must also commit its heap, because it will run using a foreign page table. If the heap is mapped to a virtual region and command FillRAM is specified for the same region, the specification of a physical region can be omitted. In this way, the heap can span several disjoint areas of physical memory. The examples given in section Stack work identically for the Locate Heap command.
|