Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Running a Program on the Target Fixed Memory Manager Virtual or Uncommitted Memory Manager Alternate Heap Manager RTTHeap Compiling and Linking with On Time RTOS-32 |
Fixed Memory ManagerThe fixed memory manager uses exactly the virtual memory assigned to the heap by the locator. The .LOC file can be inspected to see in which single consecutive address range the heap is located. The fixed memory manager will not attempt to remap pages of memory. Thus, it is able to run without paging. Reserving uncommitted address space starts at the low end of the heap area. Reserving will succeed even if the requested address range exceeds the available physical heap area. Committing memory will, of course, fail if the requested address exceeds the available heap area. Example 1:RTLoc has allocated a heap area of 2M size starting at address 1M. The program's run-time system initially reserves 4M of address space. Although 4M are not available, RTTarget-32 will allow this and return address 1M (start of the heap area) to the run-time system. During the course of program execution, the run-time system commits memory starting at address 1M. This will succeed until the available heap area of 2M is exhausted. Example 2:The application uses a DLL which contains its own copy of the run-time system. The DLL is initialized first and reserves 4M for application heap allocations. Then the .EXE's startup code also reserves 4M for the same purpose. Both calls will succeed (addresses 1M for the DLL and 5M for the .EXE), although only 2M of physical heap space are available but 8M have now been reserved. Committing memory for the DLL will succeed until all available physical memory is exhausted, but any attempt of the .EXE to commit will fail, because no physical memory is present at addresses at or above 5M. Advantages of the Fixed Memory Manager
Thus, the fixed memory manager is well suited for most applications not using DLLs or for programs using only DLLs that do not contain their own run-time system (such as Rtt32dll.dll, for example). Virtual or Uncommitted Memory Manager
|