[m-rev.] for review: fast_loose_memo

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 31 08:23:27 AEST 2005


On 20-May-2005, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Add a new form of tabling pragma, fast_loose_memo.

That sounds like an excellent idea.

> +++ compiler/prog_data.m	20 May 2005 01:27:24 -0000
> +
> +:- type call_table_strictness
> +	--->	strict
> +	;	fast_loose.

A comment here would be nice.

> Index: library/table_builtin.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/library/table_builtin.m,v
> retrieving revision 1.42
> diff -u -b -r1.42 table_builtin.m
> --- library/table_builtin.m	16 Aug 2004 03:51:06 -0000	1.42
> +++ library/table_builtin.m	8 Apr 2005 05:58:18 -0000
> +:- pragma foreign_proc("C",
>  	table_lookup_insert_poly(T0::in, V::in, T::out),
>  	[will_not_call_mercury],
>  "
> -	MR_table_lookup_insert_user(T0, TypeInfo_for_T, V, T);
> +	MR_table_lookup_insert_poly(T0, TypeInfo_for_T, V, T);
> +").

Have you got a regression test for that bug fix?
I think that would be a good idea.

> Index: runtime/mercury_tabling.c
...
> @@ -455,6 +463,46 @@
>  #undef  lookup_only
>  }
>  
> +MR_TrieNode
> +MR_word_hash_lookup_or_add(MR_TrieNode t, MR_Word key)
> +{
> +#define key_format              "%p"
> +#define key_cast                (MR_Word)

Is the net effect of the use of those macros a call of the form

	printf("%p", (MR_Word) ...);

?  If so, that's not right; it should be

	printf("%p", (void *) (MR_Word) ...);

or

	printf("%x", (MR_Word) ...);

-- 
Fergus Henderson                    |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list