Safe method wont check dangling pointer?
lzzll via Digitalmars-d
digitalmars-d at puremagic.com
Tue Apr 15 18:37:24 PDT 2014
On Tuesday, 15 April 2014 at 17:40:13 UTC, Walter Bright wrote:
> On 4/15/2014 10:26 AM, bearophile wrote:
>> Walter Bright:
>>
>>> That's what @safe is for.
>>
>> I think those sanitizers (but the integer-related one) are
>> meant to help D
>> programmers catch bugs in @system code.
>
> I understand that. I've written my own sanitizers in the past
> and used them heavily. The big advantage of @safe is that it
> offers a guarantee, sanitizers do not.
>
> Very little, however, of even a hardcore app needs to be
> @system. What little remains is often @system for performance
> reasons, where you'd turn off a sanitizer anyway.
>
> To sum up, a sanitizer for D offers little incremental benefit,
> and has a substantial implementation cost. Such cost would take
> away from other improvements to D that would be far more
> valuable.
I agree about implementation cost, and I didn't have enough
skills to do it.
I think @safe just a guide or helper, it doesn't offer a
guarantee,
because phobos and druntime use a lot of pointer, but less test
with them (or didn't release?).
Also we need pointer because many library, kernel of
windows/linux/bsd, communication api from outer device is written
in c/c++.
Free from pointer is a good dream although it is unrealistic.
Thanks that valgrind can use with d, so it's the only choise now.
More information about the Digitalmars-d
mailing list