[phobos] enforce() vs. assert() for range primitives

Walter Bright walter at digitalmars.com
Sun Aug 22 14:07:37 PDT 2010



Sean Kelly wrote:
> I think it depends on how the compiler dereferences fields of an object. GCC on OSX if I have a null ptr to a struct and I try to access a field through it I'll get the data at 0x4 or wherever and the code will keep on running.  Actual segfaults happen depressingly rarely. 
>
>
>   

On Windows, the entire first 64K of address space is reserved by the OS, 
and any attempt to access it results in a seg fault. I'm very surprised 
that OS X would not do the same.


More information about the phobos mailing list