Menu

Detecting memory leaks

P.Rouleau
2000-10-27
2001-01-15
  • P.Rouleau

    P.Rouleau - 2000-10-27

    Can we add some code around runTest() in TestCase::run() to detect a memory leak in the tested function?

    I have a solution, but it's only valid for a MS-Windows version.

     
    • Anonymous

      Anonymous - 2001-01-08

      One could add some hooks for mem leaks detection and provide whichever implementation.
      Under Visual C++/Windows, it could use built-in debug API for memory management.
      Under Unixes, a plug-in for Purify.

       
    • Robert Withrow

      Robert Withrow - 2001-01-15

      We use Purify with our test suites and it works
      pretty well *except* when a test fails.  :-(

      The current version of Purify gacks when you throw an exception using GCC 2.95.2.

      That makes me wonder why cppunit is implemented using exceptions.  It doesn't seem especially necessary, and exceptions are *still* an iffy area of compatibility in C++.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.