limit check pushed inside loop

Stephen Weeks MLton@sourcelight.com
Wed, 9 Aug 2000 11:11:47 -0700 (PDT)


> > Which raises an interesting point -- in that non-allocating loop, there is
> > a check for 24 additional bytes at each entry; probably for the
> > continuation where I print out the result, but it looks like it got pushed
> > too far back into the loop.)
> 
> This feels like a bug.  I'll look into it.

Actually, it's not a bug.  Limit checks are only inserted in a few places, loop
headers being one of them.  The amount is the max over all control flow paths to 
the next limit check.  So, even if nothing is allocated inside the loop, as long 
as one of the exits leads to allocation before a limit check, that will get
pushed inside the loop.