I know this question has been asked before, however it was asked two years ago and I have some other constraints to add.
(Previous question here) : Is using malloc() and free() a really bad idea on Arduino?
I understand that dynamically allocating and freeing memory can cause fragmentation, and without an operating system to manage the memory, this fragmentation can reach a point where no memory can be allocated because the current memory is a mess.
That being said, the only memory allocation I plan to do is for a linked list that I am using as a stack. This means that I will only even be adding or removing from one end of the linked list. In the case that the arduino
malloc() implementation is 'next fit', is it safe to assume that I can use this linked list safely, since the only element I'll be removing is the next one that fit, and everything else will stay where it is?
tl;dr the two questions I'm asking:
Is the arduino
malloc implementation 'next fit'? Where can I read up on this in detail?
A single stack running in a 'next fit' environment will never cause fragmentation, correct?