limit checks

Stephen Weeks MLton@sourcelight.com
Wed, 9 Aug 2000 10:43:16 -0700 (PDT)


> Won't this (checking that limit checks are for exactly the sum of the sizes of
> all types being allocated) prevent putting in an optimization which checks for
> more than that so that we have fewer limit checks?  I'm thinking of something
> like
> 	check for atleast A+B+C bytes available
> 	allocate A
> 	if condition
> 		allocate B
> 	allocate C
> Collapsing this to one limit check would be nice (although you have to be
> careful to maintain safe-for-space.

I think this is no problem.  I don't see any reason why the type system/dataflow
analysis couldn't have a max in it somewhere.  I'm not proposing it do limit
check inference, just checking.