Skip to content

Use C++ for the genesys backend

Povilas Kanapickas requested to merge p12tic/backends:genesys-enable-cxx into master

This PR illustrates this proposal to allow C++ on per-backend basis in the mailing list.

As can be seen, enabling C++ introduces minimal changes in the rest of the codebase: excluding generated files there are around 40 lines of extern "C" definitions in the internal headers and 15 lines of changed code in the build system.

Two benefits that will yield almost immediate improvements are the following:

  • ability to use exceptions instead of manual error handling which currently often explodes the amount of code by 4 times.

  • using simple C++ idioms to automatically free memory on function exit. This would essentially eliminate 95% of potential sources of memory leaks in the backend. I've just fixed one recently, so it's indeed an issue.

PR has been tested with genesys backend. At the moment CI does not build genesys backend because C++ is not installed in the images.

Edited by Povilas Kanapickas

Merge request reports