sql-parser
sql-parser copied to clipboard
Improve memory management
Currently the parse tree contains a large number of raw pointers to maintain the nodes. This means that we always need to explicitly delete all children upon deletion of a node. While we do have an automatic memory leak checker, the risk of memory leaks is still there and handling memory this way is cumbersome.
Possible improvements:
- Use
std::stringinstead ofchar* - Use smart pointers instead of raw pointers
We should measure the performance impact of using smart pointers. In general, I think the advantages of smart memory management will outweigh possible performance drawbacks.
Related Blog Post: Feeding a Bison with tasty C++11 grAST!