You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
"allocate memory with malloc() during the setup()". If you know from the very beginning how much memory you need, there is no point in using malloc() instead of static buffers. As to what usages of malloc() are safe, see my answer to a related question.Edgar Bonet– Edgar Bonet2016年02月01日 14:30:54 +00:00Commented Feb 1, 2016 at 14:30
-
1@EdgarBonet I seem to have missed one of the requirements; software with dynamic configuration, e.g. EEPROM variables that say number of elements, etc. The actual size of the dynamic data structure is not known at compile time or is allowed to change. In other cases, I fully agree with your objection. If the size is known avoid malloc().Mikael Patel– Mikael Patel2016年02月01日 14:45:42 +00:00Commented Feb 1, 2016 at 14:45