RSSA backend
Stephen Weeks
MLton@sourcelight.com
Thu, 17 Jan 2002 16:05:53 -0800
> > Another possibility is to simply add POINTER_SIZE to the frontier
> > uncoditionally. Then you don't need extra labels.
>
> Doesn't that screw up walking the from heap in the GC? Or do we just make
> GC_foreachPointerInObject understand that arrays always have an extra
> POINTER_SIZE of dead bytes at the end of a non-zero length array?
Something like that. There's a test I see in
GC_foreachPointerInObject (line 453) that can be eliminated as well.
> I guess that is fairly simple, although it means we're wasting a
> little bit of space on arrays.
That is the reason the decision was made to include the test. I lean
slightly towards saving the space and paying a little time.
Another way to fix the problem, while getting the space saving, is to
require that calls to Array_array have numElts > 0. We can use
another primitive, Array_array0, for creating zero length arrays.
Then the test is expressed in the SML and RSSA. The only problem is
for arrays that have 0 bytesPerElt, which isn't known until RSSA --
but those can be turned into Array_array0 at that time.