About Store Forum Documentation Contact



Post Reply 
Mem Leak Detection.
Author Message
Salival Offline
Member

Post: #1
Mem Leak Detection.
Suggestion to make the APP_MEM_LEAKS flag write a log file with:

[Addr] [FileName] [Line] [Size in bytes]

Should be good when the project is huge.

Ofc this can be done by overide the new/delete operations in main header to, But better to have it from engine =)

Something like:

inline void * __cdecl operator new(unsigned int size, const char *file, int line)
{
AddToList.
};

inline void __cdecl operator delete(void *p)
{
Remove from List.
};

At exist:

Print list (only leaks left)
(This post was last modified: 12-22-2010 03:10 PM by Salival.)
12-22-2010 03:09 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Mem Leak Detection.
It's recommended to use memory containers for storing data (Memc,Memb..), they delete memory automatically, no worries for leaks
12-22-2010 03:14 PM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #3
RE: Mem Leak Detection.
(12-22-2010 03:14 PM)Esenthel Wrote:  It's recommended to use memory containers for storing data (Memc,Memb..), they delete memory automatically, no worries for leaks

Okay.
(This post was last modified: 12-22-2010 04:08 PM by Salival.)
12-22-2010 04:07 PM
Find all posts by this user Quote this message in a reply
Post Reply