malloc/free is there a way to see if all match?
I am exposed to this project where malloc is liberally spread all over the place and wonder if memory get freed up in all cases. I would hate to see that, after a month of usage the thing blew up. A very subtle error in this respect would never show up during development where the program is reloaded many times a day, whereas at a customer where a reset may be a yearly event a small error in this respect would show up eventually.
Erik
I am exposed to this project where malloc is liberally spread all over the place and wonder if memory get freed up in all cases. I would hate to see that, after a month of usage the thing blew up.
Unfortunately even complete absence of such mismatches (a.k.a. memory leaks) doesn't really solve the problem. There's that nasty effect called heap fragmentation that will cause allocatio requestes to fail even though the total size of free memory would be sufficient to satisfy them.
The only sane approach for truly embedded systems that are expected to run indefinitely is to only use malloc() during start-up, and never free() at all --- and make sure that there's enough memory for those malloc()s in every allowed configuration.