After many years of working on a general-purpose C++ library using the Microsoft MSVC compiler in Visual Studio, we are now porting it to Linux/Mac OS X (pray for us). I hav
Since some time both clang and gcc support some "sanitizers", including the leak sanitizer. When enabled during compilation, the code is instrumented by the compiler to perform the respective checks during run-time. On gcc the leak sanitizer is enabled using "-fsanitize=leak". See https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html.