[m-dev.] diff: AGC: round 2.

Tyson Dowd trd at stimpy.cs.mu.oz.au
Sat Jul 4 15:30:27 AEST 1998


On 03-Jul-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 03-Jul-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > 
> > Here's a diff relative to my previous changes.
> > I've addressed the concerns raised in the review.
> ...
> > library/io.m:
> > 	Initialize the garbage rootset with the globals.
> 
> How come this wasn't in the relative diff?
> Shouldn't you call MR_add_root() here instead of MR_agc_add_root()?

Sorry, I only diffed the runtime.  

Here's the new version of io.m (vs the cvs archive).

Index: io.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/io.m,v
retrieving revision 1.158
diff -u -r1.158 io.m
--- io.m	1998/06/27 08:42:25	1.158
+++ io.m	1998/07/03 04:45:04
@@ -2242,7 +2242,7 @@
 :- pragma export(io__init_state(di, uo), "ML_io_init_state").
 
 io__init_state -->
-	io__gc_init,
+	io__gc_init(type_of(StreamNames), type_of(Globals)),
 	{ map__init(StreamNames) },
 	{ ops__init_op_table(OpTable) },
 	{ type_to_univ("<globals>", Globals) },
@@ -2264,14 +2264,17 @@
 	% we don't bother.)
 	[].
 
-:- pred io__gc_init(io__state, io__state).
-:- mode io__gc_init(di, uo) is det.
+:- pred io__gc_init(type_info, type_info, io__state, io__state).
+:- mode io__gc_init(in, in, di, uo) is det.
 
-:- pragma c_code(io__gc_init(IO0::di, IO::uo), "
+:- pragma c_code(io__gc_init(StreamNamesType::in, UserGlobalsType::in,
+		IO0::di, IO::uo), "
 	/* for Windows DLLs, we need to call GC_INIT() from each DLL */
 #ifdef CONSERVATIVE_GC
 	GC_INIT();
 #endif
+	MR_add_root(&ML_io_stream_names, (Word *) StreamNamesType);
+	MR_add_root(&ML_io_user_globals, (Word *) UserGlobalsType);
 	update_io(IO0, IO);
 ").
 
-- 
       Tyson Dowd           # "Bill Gates is a white persian cat and a monocle
                            # away from becoming another James Bond villan."
     trd at cs.mu.oz.au        # "No Mr Bond, I expect you to upgrade."
http://www.cs.mu.oz.au/~trd #                -- Dennis Miller and Terri Branch



More information about the developers mailing list