for review: deep copy cleanup.

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jun 3 00:54:11 AEST 1998


On 02-Jun-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> Cleanup deep copy.
> 
> runtime/mercury_deep_copy.c:
> 	Use MR_categorize_data, and switch on the result.
> 	
> 	This makes the control flow much simpler -- each case only needs
> 	to worry about copying the data.
> 	We can also use fallthru to exploit duplicated code.
> 
> 	Remove get_base_type_layout_entry, it isn't very useful.
> 
> runtime/mercury_type_info.c:
> runtime/mercury_type_info.h:
> 	Define MR_categorize_data and the enum MR_DataRepresentation.
> 
> 	MR_categorize_data can be used by any function that needs to
> 	manipulate data.

Hmm, the code for MR_table_type() in runtime/mercury_table_any.c
and ML_expand() in library/std_util.m are both similar to
the code for deep_copy().  Would it be useful to modify those to use
MR_categorize_data() too?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list