Boost logo

Boost :

Subject: Re: [boost] Review of a safer memory management approach for C++?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-06-07 10:43:18


Bartlett, Roscoe A wrote:

> I am fine with the language allowing for undefined behavior. Clearly if you want the highest performance, you have to turn off array-bounds checking, for instance, which allows for undefined behavior. What I am not okay with is people writing programs that expose that undefined behavior, especially w.r.t. to usage of memory. Every computational scientist has had the experience of writing code that appeared to work just fine on their main development platform but when they took to over to another machine for a "production" run on a large (expensive) MPP to run on 1000 processors, it segfaulted after having run for 45 minutes and lost everything. This happens all the time with current CSE software written in C, C++, and even Fortran. This is bad on many levels.
>
> Are you suggesting that people should write programs that rely on undefined behavior or are you just saying that you don't think it should be eliminated from the language?

 From my experience, the best tool to identify and eliminate undefined
behaviour due to bad memory access is valgrind.

I found it more practical and catching more errors than any
library-level tool.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk