With the Valgrind-on-Mac support coming along nicely, it’s worth addressing another widely-used platform: Windows. Will Valgrind work on Windows any time soon? There are actually two answers: (a) hell no, and (b) it already does (sort of).

The patch I merged from the Darwin branch onto the trunk yesterday was 28,300 lines. And that was almost entirely new code, because I’d done a lot of work to synchronize the branch and trunk so that all non-addition changes had been dealt with. Greg Parker spent over four years, off and on, working on the original port, and I spent close to three months full time cleaning it up, and Julian Seward also pitched in a bit. I roughly estimate the Darwin port represents at least 1,000 person-hours of work, possibly much more.

And Mac OS X is a lot closer to Linux than Windows is. Also, the Mac OS X kernel is open source, which makes a port much easier. A Valgrind-on-Windows port would therefore be an enormous undertaking, one that is unlikely to happen soon, if ever. That is how we get answer (a) above.

However, although Valgrind doesn’t run on Windows, it is possible to run Windows programs under Valgrind, thanks to Wine — you run the Windows program under Wine, and Wine under Valgrind. The development (trunk) versions of both Valgrind and Wine now have enough awareness of each other that they can apparently be used together. I say “apparently” because I haven’t tried it myself, but I know that others have had some success. But please note that this is fairly new and experimental, and should only be tried by those not afraid to get their hands dirty (this page has more details). And that’s how we get the answer (b) above.