How does valgrind work?
Valgrind basically runs your application in a “sandbox.” While running in this sandbox, it is able to insert its own instructions to do advanced debugging and profiling. From the manual: Your program is then run on a synthetic CPU provided by the Valgrind core. As new code is executed for the first time, the core … Read more