2.11.3. Writing your own memory model
If the provided memory models do not meet your requirements, you can write your own. A memory model must define the functions described in Table 2.12. All functions are ARM state functions. The library takes care of entry from Thumb state if this is required. An incomplete prototype implementation for the model is provided in rt_memory.s located in the ...\include directory.
Use the prototype as a starting point for your own implementation.
Table 2.12. Memory model functions
| Function | Description |
|---|
__rt_heap_extend() | Returns a new block of memory to add to the heap. See __rt_heap_extend(). |
__rt_stack_postlongjmp() | Atomically sets the stack pointer and stack limit pointer to their correct values after a call to longjmp(). See __rt_stack_postlongjmp(). |