robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
142 stars 31 forks source link

Devel #51

Closed ppisa closed 2 years ago

ppisa commented 2 years ago

shv: fix memory leaks in shv_ls method and minor formatting cleanup

Removed abundant malloc()s and add missing free() to release storage for the list of children nodes.

ppisa commented 2 years ago

I consider even to add variant of the string list serialization which is called with iterator, that would get rid of runtime malloc calls except for buffers during initialization. But that is for another pull round if implemented and tested.

ppisa commented 2 years ago

There is the experimental version with shv_ls rewritten to use iterators instead of malloc

https://gitlab.fel.cvut.cz/b35apo/mz_apo-servo-knobs-shv/-/commit/1642642d57ef83b9f96dfbbc5425000983883fb2

But there is strdup still in the path parsing code which is an area for the next exercise...