Skip to content

Research Questions

Artem Usov edited this page Nov 24, 2020 · 1 revision

"Can the translation of raw pointers into smart pointers using escape analysis be used to make existing C++ code more modern and extendable?"

We argue that all code using more modern language features involving memory management should always be used instead of previous methods using new/free. This is visible in the creation of languages such as Rust which introduce even more new language features.

The question we then answer is how good is the tool at achieving this aim. We measure this by taking a test-suite of programs written using C++98/03 and run the tool over the programs. The performance is then measure by if the resulting code is compilable, if it passes any tests that are included, and then ultimately we measure how intelligent the tool is by measuring the number of upgraded pointers compared to the number of raw pointers that existed beforehand.

An example benchmark that can be used is the SPEC CPU which have many, less sizeable programs written in C++, and will likely be in the older dialects that we require.

"Can the tool identify situations in which unique pointers should be used reliably?"

The paper will explain how almost all raw pointers can be upgraded into shared pointers, however these carry a performance decrease with them due to needing to do reference counting (We cannot upgrade pointers in mutually referencing objects). However, in a percentage of cases, this can be dealt with by using unique pointers. However, due to needing to be conservative in our analysis, we might not be able all situations in which a unique pointer can be used.

To measure how reliable or intelligent the analysis is, we can measure the number of unique pointers compared to the number of unique pointers + shared pointers, however this number will fluctuate massively depending on the program we run it on. For example one that handles lots of unique resources vs one that doesn't. Instead we can compare our translated programs compared to programs which were refactored manually by humans.

There can be a discussion on whether the amount of situations we are able to identify is good enough without measurable performance decreases. There can be additional analysis on whether different types of analyses achieve different results (intra/inter-procedural analysis).

Clone this wiki locally