Amber Lamplight

Archive for December, 2006

Plugging the leaks

Posted by Mark on December 7, 2006

While trying to track down an annoying memory leak with Visual C++’s debugger, I ran into an issue under which the _CRTDBG_MAP_ALLOC preprocessor flag will make it appear as though the leaky allocations all take place in crtdbg.h (where overloaded, locale-recording versions of the new operator reside).

The fix outlined in this article almost worked (using allocation breakpoints didn’t work at all), but my compiler had a hissy fit about the redefinition of the “new” operator in the supplied function. Perhaps I could have tracked that down, but my inherent laziness prompted me to a different route — collapsing the function and the #define into one. This worked fine and got me the actual location, in my program code, of the offending chunk of dynamic memory:

#ifdef _DEBUG
#define new new(1, __FILE__,__LINE__)
#endif

Don’t know whether my problems with the previous fixes stemmed from compiler settings, project differences, or versioning differences, but the above may be handy for anyone else who needs to track down a leak in VC++ 2005 Express.

Posted in Programming | Leave a Comment »

Do I need to learn maniacal laughter?

Posted by Mark on December 6, 2006

Dude.  I want the statue that goes with the Casey and Andy mad science award.

I tried to learn maniacal laughter for kung fu once (no, seriously) and I was no good at it.

Posted in Comics, Sciencey Stuff, Technology | Leave a Comment »

Things you learn by attending choral performances

Posted by Mark on December 4, 2006

The Christmas carol known as The Coventry Carol is actually about Herod’s slaughter of the male infants in Bethlehem.  Nobody ever performs it with the lyrics, so I had no idea.  Am I the last person on Earth to learn this?

In related news, I need a recording of Here We Come A-Wassailing.  Then I need some wassail.

Posted in Music | Leave a Comment »