How does D handle null pointers?

Adam B cruxic at gmail.com
Fri Aug 20 19:07:03 PDT 2010


> Walter has refused to put in null checks on the theory that the OS does it for
> you - hence the segfault. Of course, then the only way to get a stacktrace is to
> either have a segfault handler which prints one or to look at a core dump
> (assuming that you get one). Neither is a very pleasant solution.

I see.  I guess I can sympathize with Walter's perspective somewhat -
it does feel redundant for both the application AND the OS to be
checking pointers.  Perhaps then it is the OS that's holding us back.
If only we could trap a segfault signal and have the OS tell us which
thread caused it and provide some mechanism to resume the thread with
an exception...  Hopefully some Linux kernel developers are reading
this ;)


More information about the Digitalmars-d mailing list