Support a heap memory region #5

Closed
japaric opened this Issue Apr 28, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@japaric
Owner

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

This comment has been minimized.

Show comment
Hide comment
@whitequark

whitequark Apr 29, 2017

Contributor

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

Contributor

whitequark commented Apr 29, 2017

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

@japaric

This comment has been minimized.

Show comment
Hide comment
@japaric

japaric Apr 30, 2017

Owner

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
Owner

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

This comment has been minimized.

Show comment
Hide comment
@whitequark

whitequark Apr 30, 2017

Contributor

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 :)

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

This comment has been minimized.

Show comment
Hide comment
@japaric

japaric May 26, 2017

Owner

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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@whitequark

whitequark May 26, 2017

Contributor

It is quite useless.

Contributor

whitequark commented May 26, 2017

It is quite useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment