Closed stokito closed 7 months ago
Yes, I am not sure where the realloc() comes from, probably from earlier times before I had conf2struct.
I accidently posted an "accept" review (it doesn't work the way I guessed), but I want to reject the changes to Argtables: they are external files, which ideally I'd want to let up to the distribution (but Debian does not have Argtables3), and patching them means diverging from upstreams which will garantee problems down the line.
I think everything else is fine.
I dropped commits to the argtable
Thanks!
The CLion IDE has built-in CLang-Tidy linter and it marked a lot of warnings. I checked and they all looks safe but just to at least reduce the visual noise here I fied some of them.
The last commit is an optimization and simplification. You are using
realloc
in many places but the function is often allocates a new chunk of memorh and copy from old. So it may work longer. Instead we can pre-allocate the array but fill with only needed elements. So we have one alloc instead of N. We may use slightly more memory but that's fine.https://stackoverflow.com/questions/6727136/performance-impact-of-realloc