I am trying to allocate space for a heap structure that is to be used by user-managed dynamic memory allocation (as opposed to compiler-managed) . I would like for this structure to take up the rest of remaining RAM, no matter what it may be. I want this structure to be resized accordingly as my codebase changes and global variables may come and go through different firmware revisions.
Does anyone have an idea for the "right" way to do this?
My idea right now is to have a section for this structure in the linker command file that places it at _STACK_END, effectively at the beginning (LBA) of the remaining space. However, I'm having a hard time figuring out how to make the size of this section available at runtime.
Any help would be appreciated.
Thanks,
Mateja