sql-parser icon indicating copy to clipboard operation
sql-parser copied to clipboard

Improve memory management

Open torpedro opened this issue 8 years ago • 0 comments

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::string instead of char*
  • 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!

torpedro avatar Jul 26 '17 18:07 torpedro