safe for space ... and IntInf

Stephen Weeks MLton@research.nj.nec.com
Tue, 27 Jun 2000 19:26:18 -0700 (PDT)


> The bignum code pretty much has to depend on the fact that certain temporaries
> are allocate JUST before the call so that it can shrink them back to their
> desired size.  Only the last thing allocated can be shrunk.  I'm glad I put
> the assert in the code.

me too.

> One solution (a hack) would be to handle the flatening of Prim.??? args
> specially.  I.e., Prim.??? takes its arguments flattened out.  This corresponds
> to reality, so it isn't SO crazy.

Prim args are flattened even with the flattener turned off.  The
problem is that there is a lambda wrapped around the primitive that
coerces from the tuplized representation to the flattened one.  It is
this lambda which either has to be flattened (or inlined).

> Well, we could make the Prim guys curried (yuck). 

This doesn't help either, for the reason given above, and because
currying, without optimization, causes an allocation for the
intermediate closure.

I'm inclined to leave the problem be -- but I'd at least like to put a 
reminder or assert somewhere to avoid tracking down this bug next time 
I do stress testing.