Why dont dlang check NullPointer?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 27 13:01:00 PDT 2015


On Friday, 27 March 2015 at 14:39:36 UTC, Shammah Chancellor 
wrote:
> All the languages you mention run in a VM.   In the case of a 
> systems language like D, the operation system itself is 
> intercepting the reference to invalid memory and sending a 
> SIGSEG to the process.  The default handler causes the process 
> to immediately terminate.   Having the D runtime do something 
> different in the SIGSEG handler by default would be bad form.
>
> -Shammah

Most VM use segfault trapping for null check.


More information about the Digitalmars-d mailing list