This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Eigen on Visual Studio 2008

Tags: None
(comma "," separated)
Hauke
Registered Member
Posts
109
Karma
3
OS
Hi,

I would quickly like to recommend Dan Moulding's 'Visual Leak Detector'. Of what I know about, it is the most easy to use non-commercial leak detector on Windows (when you are developing with Visual Studio .Net).

Edit (the link): http://dmoulding.googlepages.com/vld

Pros: tine, free (LGPL), can be enabled/disabled per code block
Cons: lib+dll, visual studio only, ...

It is probably possible to recompile the code into a static lib, if you want to.

Your code from before with VLD looks like this

Code: Select all
#include

// #define EIGEN_DONT_ALIGN // compiles ok now if EIGEN_DONT_ALIGN
#include

USING_PART_OF_NAMESPACE_EIGEN

int main( int argc, char* argv[] )
{
  new int(123); // memory leak!

  MatrixXf a;
  a = MatrixXf::Zero( 123, 123 );
  return 0;
}


and it produces the following clean output (it even allows you to follow the call stack via double-clicks)

Code: Select all
Visual Leak Detector Version 1.9h installed.
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 0 at 0x013068D8: 4 bytes ----------
  Call Stack:
    c:...main.cpp (10): main
    f:ddvctoolscrt_bldself_x86crtsrccrtexe.c (586): __tmainCRTStartup
    f:ddvctoolscrt_bldself_x86crtsrccrtexe.c (403): mainCRTStartup
    0x7C817077 (File and line number not available): RegisterWaitForInputIdle
  Data:
    7B 00 00 00                                                  {....... ........

Visual Leak Detector detected 1 memory leak.
Visual Leak Detector is now exiting.


Cheers,
Hauke

Last edited by Hauke on Mon May 04, 2009 5:55 pm, edited 1 time in total.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]