Skip to content

Memory manager to safely use malloc() from other libraries #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ppescher opened this issue Oct 1, 2018 · 1 comment
Closed

Memory manager to safely use malloc() from other libraries #9

ppescher opened this issue Oct 1, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ppescher
Copy link

ppescher commented Oct 1, 2018

The current options in the portable/MemMang directory cannot provide thread safety for those Arduino libraries that directly call malloc() family of functions (e.g. STM32SD, String).

I have ported some code here: RoboTech-srl@897009a

Before making a PR, I was wondering if configMEMMANG_HEAP_NB == -1 was a good choice. I thought the number of heap implementations might grow in future versions, so I went negative. What do you think @fpistm ?

I also think that the default _sbrk() provided by the core must be defined as a "weak" symbol for this to work. See fortebit/fortebit-openiot-stm32-core@169ced0

@fpistm fpistm self-assigned this Oct 1, 2018
@fpistm fpistm added the enhancement New feature or request label Oct 1, 2018
@fpistm
Copy link
Member

fpistm commented Oct 1, 2018

Thanks @ppescher
I will checkout this tomorrow, I'm currently working on an issue around malloc #8.
As I pointed in the thread and during my investigation I've planned to give a try to this heap_useNewlib.c which is provided in the link I've post to @rayozzie.
Nice to have your proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants