[m-dev.] MR_GC_check

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 4 13:40:45 AEDT 2003


On 04-Mar-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 04-Mar-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > Yes.  If you check in the procedure prologue (inside the loop for
> > directlyrecursive tail calls, if any) it is not necessary to check before
> > directly recursive calls.
> 
> Unfortunately, this is not quite true. Consider
> 
> p(...) :-
> 	<construct cell 1>
> 	q(...)
> 	( ... ->
> 		<construct cell 2>
> 	;
> 		...
> 	).
> 
> Even if the heap has room for both cells when entering p, the construction
> of cell 2 can run out of memory if q consumed some of the memory that was
> still available when entering p.

Oh.  Good point.  :-(

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list