toolkit memory usage

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
frigodedo

toolkit memory usage

Post by frigodedo »

Hi, i want to do a class for debug my projects.

I would like know if anyone have done any type of class or code for debug theirs projects and know if the has leaks memory , of what use of memory it has

Anyone has a toolkit , classes,or snippet code for debug projects in builting

thanks
don_Pedro
Posts: 84
Joined: Fri Jun 10, 2005 1:34 pm
Location: Poland
Contact:

Post by don_Pedro »

Add these lines:

Code: Select all

#ifdef _DEBUG
#include  "crtdbg.h"
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
and these to the main function:

Code: Select all

#ifdef _DEBUG
	int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
	flag |= _CRTDBG_LEAK_CHECK_DF;
	_CrtSetDbgFlag(flag);
#endif
This will cause to dump all memory leaks at the finish of program execution when in debug mode. Using function _CrtDumpMemoryLeaks(); you can dump them in any place in your code.
frigodedo

Post by frigodedo »

ummm. thanks don_Pedro
frigodedo

Post by frigodedo »

Can you put an example with tutorial 2 of irrlicht (quake map) ?

Thanks
Post Reply