IntInf asserts (fwd)

Matthew Fluet fluet@CS.Cornell.EDU
Fri, 2 Nov 2001 13:41:07 -0500 (EST)



---------- Forwarded message ----------
Date: Fri, 2 Nov 2001 13:40:55 -0500 (EST)
From: Matthew Fluet <fluet@snoball.cs.cornell.edu>
To: Henry Cejtin <henry@sourcelight.com>
Subject: Re: IntInf asserts


> Yes, the point of the asserts is that the C routines roll the heap frontier
> back (since the ML code before allocates an upper bound on what they need).
> The assert makes sure that the space pointer it gets was the last thing
> allocated.  Is there some way that these final flattens could be handled
> specially?  Maybe some kind of primitive that takes the amount to allocate
> and the C routine to call, and then it would do things in the right way?
> Not very nice.

Well, we could always change the types of things like:

	    val + = _prim "IntInf_add": int * int * word array -> int;

to

	    val + = _prim "IntInf_add": int * int * Int.int -> int;

It should be easy to increment the frontier by that third argument; now,
it depends on how much the intInf code depends on that array be
initialized in the appropriate way, or if it will just trash whatever is
there.

What this really adds is to the limitCheck insertion code, which now needs
to know that IntInf_add and friends do implicit allocation, just like
Array_array does.