dereferencing null

Sandeep Datta datta.sandeep at gmail.com
Sat Mar 3 12:29:18 PST 2012


I would recommend doing what Microsoft does in this case, use SEH
(Structured exception handling) on windows i.e. use OS facilities
to trap and convert hardware exceptions into software exceptions.

See the /EHa flag in the Microsoft C++ compiler.

I hope Linux has something similar, then we are all set!

ref:
http://msdn.microsoft.com/en-us/library/1deeycx5(v=vs.80).aspx

On Saturday, 3 March 2012 at 02:51:41 UTC, Walter Bright wrote:
> On 3/1/2012 8:51 PM, Jonathan M Davis wrote:
>> It's defined. The operating system protects you.
>
> Not exactly. It's a feature of the hardware. You get this for 
> free, and your code runs at full speed.
>
> Adding in software checks for null pointers will dramatically 
> slow things down.



More information about the Digitalmars-d mailing list