bug found

Stephen Weeks MLton@sourcelight.com
Tue, 27 Nov 2001 10:20:40 -0800


> From my reading of the object header comments, but 29 must be a 1  for
> the object to be a stack.

Yes.

> No, I think that the code isStackHeader is just plain broken.  It only showed
> up in this example because the last array growth made a char array with  2^28
> elements, thus setting bit 28.

I agree.  There are actually two problems, isStackHeader, and
GC_MAX_ARRAY_LENGTH.  I have checked in a fix.  Please check me,
especially on the GC_MAX_ARRAY_LENGTH.  Unfortunately, if I am
correct, then we are now restricted to arrays with < 2^29 elements.

> I assume:
> 
>     A normal object ia any object with
>         bit 31 set to 1.
> 
>     An array is indicated by an initial world which has
>         bit 31 set to 0
>         bit 29 set to 0.
> 
>     A stack is any object with
>         bit 31 set to 0
>         bit 29 set to 1
>         bit 28 set to 0.
> 
>     A continuation object is any object with
>         bit 31 set to 0
>         bit 29 set to 1
>         bit 28 set to 1.

Your assumption jibes with the comment in gc.c from line 17 to line
36, so I believe it is correct.

> It isn't clear if isStackHeader is supposed to return false on cont's.

It should return true.  I changed the name and fixed it to test bit 29
only.