[m-dev.] for review: use `impure' to implement builtin_aggregate

Tyson Dowd trd at cs.mu.OZ.AU
Tue Oct 19 14:28:11 AEST 1999


On 19-Oct-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Estimated hours taken: 4
> 
> library/std_util.m:
> 	Implement `builtin_aggregate' using impure Mercury
> 	and some `pragma c_code' fragments, rather than
> 	using completely hand-coded low-level C code.
> 	
> 	This has several benefits:
> 		- it should allow the accurate garbage collector
> 		  to trace code using solutions/2, without
> 		  needing to hand-code the liveness information
> 		- the compiler can specialize the higher-order
> 		  calls in builtin_aggregate
> 		- the code is simpler and much more high-level,
> 		  and thus should be easier to maintain.


This change seems fine.  There are a few small comments below.

> 
> Workspace: /d-drive/home/hg/fjh/mercury
> Index: library/std_util.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/library/std_util.m,v
> retrieving revision 1.164
> diff -u -c -r1.164 std_util.m
> cvs diff: conflicting specifications of output style

Yeah, I'd prefer -u.

>   ** while the collector pred is executing, and by the time the nested do_ is
>   ** completed, the 'real' heap pointer will have been reset.
> + **
> + ** If the collector predicate throws an exception while they are swapped.
> + ** then the code for builtin_throw/1 will unswap the heaps.

s/swapped\./swapped,/

Otherwise it looks good.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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