big arrays [was Re: bug found]
Stephen Weeks
MLton@sourcelight.com
Tue, 27 Nov 2001 12:01:25 -0800
> The only thing we need to do is to distinguish between array lengths
> and object headers. So, if we make array lengths two words, the first
> of which will always be all zero, and the second containing the
> length, as it does now, we can have lengths up to 2G, which is the max
> we can hope for with 32 bit ints anyways. There is no additional cost
> for bounds checking. The only cost is an added word of space per
> array.
Although I'm hard pressed to argue that this is better than my other
proposal of reworking object headers so that only arrays have a top
zero bit. That also has no additional cost for bounds checking. The
only cost may be in a slightly more complex gc.