Slashdot Mirror


Memory Checker Tools For C++?

An anonymous reader writes "These newfangled memory-managed languages like Java and C# leave an old C++ dev like me feeling like I am missing the love. Are there any good C++ tools out there that do really good memory validation and heap checking? I have used BoundsChecker but I was looking for something a little faster. For my problem I happen to need something that will work on Windows XP 64. It's a legacy app so I can't just use Boosts' uber nifty shared_ptr. Thanks for any ideas."

6 of 398 comments (clear)

  1. I've used... by grusin · · Score: 2, Funny

    Some time ago i was using valgrind, but afaik it does not run under windows. I think that MS Dev has some memory leak detection built in, but it is far behind valgrind. Besides, who codes stable stuff for windows? :)

    1. Re:I've used... by inviolet · · Score: 5, Funny

      Memory checkers? GARBAGE COLLECTORS?! Have you no HONOR?!

      We are KLINGON. We need no checkers. We need no garbage collectors. We need none of these weak HUMAN facilities. We write our CODE from the COMMAND LINE:

      > COPY CON DECAPITATOR.EXE
      [Alt+077] [ALT+090] . . .

      --
      FATMOUSE + YOU = FATMOUSE
  2. Re:Duh! by WrongSizeGlass · · Score: 4, Funny

    Replace new/delete, malloc/free, whatever/whichever, with your own tracking version. In the end you may come out with an even better idea of memory handling for whatever you are working on at the time. God-awful simple you idiot !! You disgust me that you are so stupid !! Just replace that post with your own comment system, such as replacing God-awful with I'm, idiot with smart, disgust with inspire and stupid with curious.
  3. Re:Boost? Ugh by bzipitidoo · · Score: 2, Funny

    How about some Reverse Polish (aka postfix): v1 v2 +

    Gets rid of all those pesky parentheses, simplifies the syntax. What's not to like, unless you're a LISP fan? ;)

    For grep's sake, you could, oh, I dunno, use comments? v1 v2 +; //vectorAdd
    Or, maybe write out the function name? v1.operator+(v2);
    Possibly even specify the class name too? Not sure of the exact syntax, perhaps: Vector::v1.operator+(v2) or v1.Vector::operator+(v2). If postfix was allowed, maybe: v1 v2 Vector::operator+();

    Oh, and are you not a fan of OOP, which I thought was the whole point of C++? Otherwise shouldn't your example be v1.vectorAdd(v2) ?

    --
    Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
  4. Don't use pointer arithmetic? by wonkavader · · Score: 2, Funny

    - Avoid pointer arithmetic.

    But why use C++ if you're not using pointer arithmetic? If you're not doing that, go to Java. I know this sounds silly, and it opens religious issues, but (aside from legacy apps, like this one) why would I want to use C++ if I'm not doing that?

    I use C because it's small, fast, convenient and portable. I can code something tiny quickly.

    I use Java because it's an object oriented language that helps with complex app coding.

    I use C++ because I want some of that Java stuff, but I want it to bind to my memory model more realistically. ie. Pointer arithmetic.

  5. Use FORTRAN by clickety6 · · Score: 1, Funny

    ... or maybe COBOL or LISP... ;-)

    --
    ----------------------------------- My Other Sig Is Hilarious -----------------------------------