Re: Debugging memory corruption? (C++)
Re: Debugging memory corruption? (C++)
- Subject: Re: Debugging memory corruption? (C++)
- From: "Sean McBride" <email@hidden>
- Date: Fri, 30 Oct 2009 12:19:44 -0400
- Organization: Rogue Research Inc.
On 10/30/09 4:24 PM, Jean-Denis Muys said:
>My code is corrupting memory and I have a hard time finding the bug.
>Perhaps somebody can point me to some tool or idea that has escaped me
so far.
If your app can 1) run on 10.5 2) can run as 32 bit 3) does not use
Obj-C garbage collection, then try valgrind:
<http://valgrind.org/>
It's awesome.
>One question comes to mind right away: is there a way to call the malloc
>heap-checking routines from my program? I could then sprinkle my code
>where it makes sense with heap checks.
>
>Somewhat related is that I have set MallocCheckHeapEach to 100. This
>already slows the app down quite a bit. I can probably set to an even
>smaller value, but I don't think I can set it to 1.
>
>Or if I change it to 1 *at run time* how can I inform malloc that I want
>the frequency to change? AFAICS, it only reads those environment
>variables at launch time.
I remember wanting exactly that. I don't think you can. The best you
can do is set Each to 1, and Start to some higher value.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden