README 1.1 KB

1234567891011121314151617181920
  1. You can use this script and suppressions file to run SuperTux under Valgrind
  2. ( http://www.valgrind.org/ ) to catch memory errors and leaks.
  3. Some things to be aware of:
  4. - Some C++ objects appear to use interior pointers, which will cause valgrind to
  5. report parts of their still-reachable instances as "possibly lost". You can
  6. ignore those reports.
  7. - In the GNU C++ library, a std::string object contains a pointer to a
  8. heap-allocated "representation" buffer containing the actual data. If you
  9. free a heap-allocated std::string S without destructing it (uncommon but not
  10. unheard of), you'll leak the representation. But representations are shared
  11. and copied on write, so if S was a copy of another string S', Valgrind will
  12. blame the leak on the code that created S' because that was when the
  13. representation was allocated. (Valgrind doesn't know any better without
  14. instrumenting constructors and destructors.) Watch out for this. When it
  15. first happened to me (Matt McCutchen), I was stumped for a while; finally,
  16. I wrote some small test programs and realized what was happening.