3 ms·
I had to implement my own malloc/free/etc. on an embedded project recently, due to a lack of thread-safety in the vendor's C stdlib * . I wrote a blog post abou
by silentbicycle 13y ago
I had to implement my own malloc/free/etc. on an embedded project recently, due to a lack of thread-safety in the vendor's C stdlib * . I wrote a blog post about it (http://spin.atomicobject.com/2013/04/17/embedded-memory-undefined-behavior/ http://spin.atomicobject.com/2013/04/17/embedded-memory-unde...), with a couple lessons I learned along the way.
* There were compiler flags to generate a version of the stdlib with user-provided mutex functions for an RTOS. I did so, then confirmed (by reading the stdlib's malloc's disassembly) that it never called them!