Garbage collection and memory leak detection for C and C++