paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paragui-users] a tool


From: John Popplewell
Subject: Re: [paragui-users] a tool
Date: Sat, 17 Aug 2002 20:07:52 +0100

Hi,

I use the supplied debug routines. Just add this include:

#include <crtdbg.h>

and then add this:

_CrtSetDbgFlag( 
    _CRTDBG_ALLOC_MEM_DF | _CRTDBG_DELAY_FREE_MEM_DF | 
    _CRTDBG_LEAK_CHECK_DF
               );

in your 'main' as near as possible to the start of execution.

It will alert you to memory leaks, multiple free problems,
accessing freed memory, corruption of the heap by overwriting
the beginning and end of a memory block etc. Checkout the
documentation.

My favourite is when a memory leak is reported (on exit) it is
given an ID that can be used in _CrtSetBreakAlloc( ID ); to break
execution at the point where this block is being allocated (on a 
second identical run).

The only downside is that if the flag to check on every alloc/free
(_CRTDBG_CHECK_ALWAYS_DF) is used, execution can slow to a crawl.

Works for C and C++ programs - all you have to do is add the above
lines, recompile, and relink,

cheers,
John.


----- Original Message ----- 
From: "taurus" <address@hidden>
To: "paragui" <address@hidden>
Sent: Friday, August 16, 2002 8:27 PM
Subject: [paragui-users] a tool


> Hello,
> 
>       Can anybody tell me what the utility (a good one) I can use to
>       track down the memory licks and possible pointer loss in Windows
>       app, working in Visual Studio 6.0?
> 
>       I`m trying to hunt the bug which cause my paragui application
>       explode in very unusual places :( For instance, on freeing the
>       object or SDL surface...
> 
> 
> Kind regards,
>        taurus                          
> 
> address@hidden
> 
>  ->> "If you will have a megaphone, you will never have to be alone..."
> 
> 
> 
> 
> _______________________________________________
> paragui-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users




reply via email to

[Prev in Thread] Current Thread [Next in Thread]