Search code examples
c++windows-mobilememory-leakswindows-cecrtdbg.h

How to detect leaks under WinCE C/C+ runtime library?


I know the possibilities of basic leak detection for Win32 using the crtdbg.h header, but this header is unavailable in the CE CRT library headers (i'm using the lastest SDK v6.1).

Anyone knows how I can automatically detect leaks in a WinCE/ARMV4I configuration with VC 9.0? I don't want to override new/delete for my class hierarchy, I would prefer ready to use and tested code.


Solution

  • At work (developing WindowsCE based OS + Applications) we have created our own memory manager, roughly based on the Fluid Studios Memory Manager (the link which I found using SO!). I'm pretty sure with a few simple modifications you could adapt it to use on your platform.

    Basically it doesn't override new and delete, but instead uses the preprocessor to add extra reporting to it. Then once the program exits it generates an output file of memory leaks.