Follow Slashdot stories on Twitter


Forgot your password?
Programming IT Technology

Memory Checker Tools For C++? 398

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."
This discussion has been archived. No new comments can be posted.

Memory Checker Tools For C++?

Comments Filter:
  • by grusin ( 1112113 ) on Wednesday June 06, 2007 @05:50AM (#19408503)
    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? :)
  • Re:Duh! (Score:5, Funny)

    by WrongSizeGlass ( 838941 ) on Wednesday June 06, 2007 @06:17AM (#19408641)

    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.
  • by inviolet ( 797804 ) <slashdot@ideasma ... g minus caffeine> on Wednesday June 06, 2007 @09:25AM (#19409697) Journal

    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:

    [Alt+077] [ALT+090] . . .

  • by bzipitidoo ( 647217 ) <> on Wednesday June 06, 2007 @09:34AM (#19409803) Journal

    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) ?

  • by wonkavader ( 605434 ) on Wednesday June 06, 2007 @09:41AM (#19409877)
    - 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.
  • Use FORTRAN (Score:2, Funny)

    by clickety6 ( 141178 ) on Wednesday June 06, 2007 @10:07AM (#19410225)
    ... or maybe COBOL or LISP... ;-)

UNIX is many things to many people, but it's never been everything to anybody.