Skip to main content
gamedev.net
🔒 Locked

Memory Allocation

Started by Yaskil Jan 24, 2003 at 2:38 AM 2 replies 650+ views
Original Post
Yaskil
Yaskil
the search feature is not functioning so i dont know whether same post has been posted from other user sorry for that can i learn whether i left any unfreed memory, or freed all of allocated memory after execution of my application. is there a function which shows amount of unfreed memory (for platform windows) for specific thread/application ??? [edited by - yaskil on January 24, 2003 3:39:30 AM]
Life is beautiful
ToohrVyk
ToohrVyk
I don't think such a thing exists, but I believe there are some programs out there that detect memory leaks.

Also, you could turn your malloc/new/free/delete calls using macros, something like this:

#define malloc(X) malloc(X); Memory::usedmem++

This would tell you not the amount of memory (which I find quite useless, and hard to get) but the number of times there was an allocation unmatched by an allocation (much more useful for debugging purposes).

Just create a class with a static long "usedmem" so you can access it from anywhere.

EDIT - stupid me... where did I see malloc has two parameters?

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more

[edited by - ToohrVyk on January 24, 2003 3:59:36 AM]
niyaw
niyaw
http://www.gamedev.net/community/forums/topic.asp?topic_id=134749
Yaskil
Yaskil
yep thanks a lot guys
Life is beautiful

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.