Spec#, nullables and more

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Nov 5 17:40:16 PDT 2010


On 11/5/10 6:54 PM, Michel Fortin wrote:
> On 2010-11-05 19:27:03 -0400, Walter Bright <newshound2 at digitalmars.com>
> said:
>
>> Andrei Alexandrescu wrote:
>>> The language may limit the static size of object. That's what Java
>>> does - it limits the size of any class to 64KB, and then every VM
>>> implementation guarantees that the first 64KB are made verboten one
>>> way or another.
>>
>> I've meant to do that in D, but haven't gotten around to it.
>
> On 32-bit OS X, that limit is 4 KB.
>
> And what happens if I dereference a null pointer to a static array of
> 65k elements and I try to read the last one?
>
> Disallowing objects longer than 64 KB can help, but it's not a complete
> solution.

It is - it all depends on choosing the right limit for all OSs.

Andrei


More information about the Digitalmars-d mailing list