malloc in embedded systems [duplicate]

自作多情 提交于 2019-12-04 05:23:24

For your situation your own implementation of malloc or dlmalloc is definately possible, but not advisable.

On very low level embedded systems, bare metal MCU's etc, using malloc is pointless.

You will be running your app and only your app on them, you know how much memory you have and can use, and you are fully able to tailor your program to fit such needs. With malloc you save memory, but that is pointless here. If your program at its highest memory usage does not exceed the memory available on the device, and your program is the only one running, there is no reason to use malloc, and no reason to let any memory go unused.

tl;dr Its possible but exceedingly pointless.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!