views:

827

answers:

2

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.

+2  A: 

You want to use either AppVerifier or Entrek CodeSnitch. I've had much better luck getting CodeSnitch working in a short period of time. The caveat there is I don't do a whole lot of WinMo - mostly vanilla CE. I believe there are connectivity issues with CodeSnitch and newer WinMo devices (Platman versus Corecon), but I also believe that Entrek either has a beta or a patch that works for it. My recommendation would be to call Entrek (don't email, they're busy so a call will be your quickest route to info) and only if you find that it won't work, then look into AppVerifier.

ctacke
CodeSnitch is not free :( and AppVerifier is not available for Windows Mobile (i didn't mention the Mobile variation of CE). Anyway, 1 vote for your response, thank you! :)
Hernán
Maybe I should code my own leak detector overloading new/delete, I need for now pretty basic stuff.....
Hernán
You didn't say you were after free, and I can say that the price for CodeSnitch is paid back in spades the first time you use it. A tool that saves weeks of looking for esoteric memory bugs is very, very worth paying for.
ctacke
+4  A: 

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.

Daemin
good thank you very much!
Hernán
I'm with Fluid Memory Manager for my WinCE dev. Thank you very much, this is the leaking detector I was looking for!!!!
Hernán
That doesn't compile for me (cannot find `unlink` or `_unlink` or `_wunlink`, even after including `wchar.h` and `io.h` (which doesn't exist))
BlueRaja - Danny Pflughoeft
Do you have all of the necessary preprocessor constants defined? Are you linking to the right libraries? Sounds to me like you might not have the project set up right.
Daemin