how to heap check in Darwin

mkwan

Tech
I know in VC++ this piece of code will enable me to do heap checking whenever I do debugging

#include "crtdbg.h"

int main(void)
{
...
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
...
}

I don't know how to do heapchecking when I am using terminal, how does one do one ( esp for basic DMA console programs like link lists...)

thanks
 
What exactly are you needing from this? Memory usage profiling, leak checking? Also, which API are you using? Obj-C can easily be profiled for usage and leaks via a separate utility included in the Dev Tools kit. However, Carbon is a little more difficult, and a command-line *nix app is nearly impossible as of 10.1.5 due to lack of profiling libraries ported from Linux or BSD.
 
Back
Top