Verifying memory deallocation in Windows

Started by
0 comments, last by SiCrane 18 years, 8 months ago
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
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().

This topic is closed to new replies.

Advertisement