Jump to content
  • Advertisement
Sign in to follow this  
Carolina

Verifying memory deallocation in Windows

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there! I have an urgent problem >.< How do I verify if my program has really deallocated all dynamic memory used? At Linux,it would be something like this: /*At the beginning:*/ struct mallinfo info = mallinfo(); int InitialDinMem = info.uordblks, FinalMemDin; /*Then,after using the whole free() stuff:*/ info = mallinfo(); FinalMemDin = info.uordblks; if (InitialMemDin!=FinalMemDin) printf("\n\nDynamic memory was not totally deallocated (%d %d)", InitialMemDin,FinalMemDin); My problem is,this is for LINUX,and I´m using Windows...What do I do? And I´m using GCC,since my program code is in C. Thanks in advance, Carol

Share this post


Link to post
Share on other sites
Advertisement
Depends on which gcc version you have installed. If you have a cygwin gcc build then you should still be able to use mallinfo(). If you have a MinGW gcc build then you can use _heapwalk(), though it isn't quite as straightforward as mallinfo().

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!