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.