Michel Fortin wrote:
On 2010-11-05 19:27:03 -0400, Walter Bright <[email protected]>
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.
That's good to know.
And what happens if I dereference a null pointer to a static array of
65k elements and I try to read the last one?
Array index out of bounds.
Disallowing objects longer than 64 KB can help, but it's not a complete
solution.
It's pretty darn close.