I am have to continue someone else's arduino code. This code sometimes seem to randomly produces behavior that i suspect is due to the arduino resetting itself, which could be caused by memory overflow.
Reading through the code, I can see that
- the guy made an extensive usage of the arduino String class
- it looks like the code of someone who is used to python on PC where memory is often overlooked. i see many opportunities for memory overflow.
Reading through the official String class documentation, i struggle to find there a link towards actual implementation in order to understand how the memory allocation is being done. That reminds me a lot garbage collections nightmares caused by abuse of String objects in java back in the 90s
I would rather get rid of String entirely, but if i go that path, i would have to rewrite the entire program + a thrid party lib. Besides, maybe the behavior has nothing to deal with String object and i may write an even poorer code myself anyway.
- in general when i read the arduino documentation, where can i find the corresponding implementation source code?
- in particular, where is the implementation for the arduino String class?