Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Support a heap memory region #5

Closed
japaric opened this issue Apr 28, 2017 · 5 comments · Fixed by #11
Closed

Support a heap memory region #5

japaric opened this issue Apr 28, 2017 · 5 comments · Fixed by #11

Comments

@japaric
Copy link
Member

japaric commented Apr 28, 2017

The obvious place to place this region is right after the .data + .bss region. Should we go ahead with that or should we support placing it at a custom address?

@whitequark
Copy link
Contributor

That sounds good as a first approximation, and doesn't have any critical issues I can think of.

@japaric
Copy link
Member Author

japaric commented Apr 30, 2017

FWIW, you can already create a heap with the current version of this crate. The _edata symbol already points to the end of .data so you can use it as the start of the heap.

Here are some instructions on how to use the alloc-cortex-m crate to allocate a Vec. The instructions assume a cortex-m-quickstart setup.

I think the next steps for this issue would be

  • create a proper _heap_start symbol that is just an alias of _edata
  • write documentation about the _heap_start symbol here
  • add an example to cortex-m-quickstart that shows how to initialize and use an allocator

@whitequark
Copy link
Contributor

whitequark commented Apr 30, 2017

Yeah, I've seen alloc-cortex-m. I actually have no need in these instructions (at least right now) because all of my code (especially my TCP/IP stack) is designed to be heap-less :)

@japaric
Copy link
Member Author

japaric commented May 26, 2017

I have seen some linker scripts declare a .heap section in the linker script. Has Anyone any need for that? I can't think of any use for such section myself.

@whitequark
Copy link
Contributor

It is quite useless.

japaric added a commit that referenced this issue May 27, 2017
rukai pushed a commit to rukai/cortex-m-rt that referenced this issue May 1, 2021
Update alloc API to latest nightly
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants