views:

19

answers:

1

On Windows, I've long been used to the debug CRT's _CRT_LEAK_CHECK_DF functionality. When the program finishes, and once all the atexit callbacks and (in C++) global destructors have been run, it prints out a list of all the still-allocated malloc and new blocks. This is pretty crude, and the output isn't actually terribly useful, but it is pretty reliable, and it lets one spot at a glance whether any leaks have been introduced.

Is there some equivalent for Mac OS X? I'm looking for anything that will run every time I run the program under the debugger, without any effort involved, run quickly, and leave the output (i.e., any info available about the still-allocated regions) in the debugger's gdb window. I'm not bothered about anything clever, since I can go deeper with leaks or Instruments or what have you once something crops up in this list.

A: 

Instruments, I believe, is really the only thing available. If you're looking to both run in debug mode as well as have Instruments record zombies, leaks, etc., then I think you're out of luck.

Joshua Nozzi