Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Questions about heap(s) #417

Closed
josesimoes opened this issue Feb 29, 2016 · 4 comments
Closed

Questions about heap(s) #417

josesimoes opened this issue Feb 29, 2016 · 4 comments

Comments

@josesimoes
Copy link
Contributor

Looking at the scatterfiles it seems that two heap regions exist.
One referred as heap, that I understand its the one managed by the CLR, correct?
And there is a "custom heap" who's purpose is unclear to me. Could someone please explain it to me?

@smaillet-ms
Copy link
Member

Custom heap is, as the name implies custom to a particular firmware build. It is available to the native code implementation, and not used by the CLR. NETMF was designed at a time when the C++ runtime libraries for Micro Controllers tended to pull in the world, so it has options to handle most of the basics of a C runtime library with as little overhead as possible.

@josesimoes
Copy link
Contributor Author

@smaillet-ms just to be 100% sure that I understood you correctly: this region would be the equivalent to the a regular heap region of a "non-NETMF" C/C++ solution. Is this correct?

@smaillet-ms
Copy link
Member

Pretty much, yes. NETMF was designed at a time when embedded C runtimes were pretty FAT. (newlib-nano and other such micro controller bare-metal focused run-times did not exist. ) Thus it uses its own implementations for the subset of standard runtime functionality it needs. Fast forward to the year 2015 and it's a different world... Part of the HAL/PAL refactoring conversation includes leveraging existing runtime support libraries and deprecating custom implementations.

@josesimoes
Copy link
Contributor Author

👍
Got it. Thanks!

josesimoes added a commit to Eclo/netmf-interpreter that referenced this issue Mar 11, 2016
- remove references to SimpleHeap projects
- remove calls to SimpleHeap config and init
- remove Simple Heap declarations from TinyHal.h
- replace private_malloc and private_free with standard C malloc and free
- implement redirect functions for private_malloc and private_free because they were being referenced from the pre-compiled crypto libs
- rework scatter files to have a managed heap and standard heap that are managed from C standard code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants