[m-rev.] diff: MLDS->C accurate GC bug fixes

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 30 23:46:19 AEDT 2002


Oops, I forgot to include one file in this diff.

--- CHANGES.orig	Wed Jan 30 23:45:03 2002
+++ CHANGES	Wed Jan 30 23:44:58 2002
@@ -33,5 +33,6 @@
 
 library/io.m:
 runtime/mercury_library_types.h:
+runtime/mercury_file.c:
 	Implement stream ids for NATIVE_GC.
 
Index: ../runtime/mercury_file.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_file.c,v
retrieving revision 1.2
diff -u -d -r1.2 mercury_file.c
--- ../runtime/mercury_file.c	23 Oct 2000 13:42:04 -0000	1.2
+++ ../runtime/mercury_file.c	30 Jan 2002 10:36:56 -0000
@@ -12,15 +12,22 @@
 #include "mercury_file.h"
 #include "mercury_std.h"	/* for MR_assert */
 
+#ifdef NATIVE_GC
+  static int next_id = 0;
+#endif
+
 #ifndef MR_NEW_MERCURYFILE_STRUCT
   void
   MR_mercuryfile_init(FILE *file, int line_number, MercuryFile *mf)
   {
 	MR_file(*mf)	    = file;
 	MR_line_number(*mf) = line_number;
+  #ifdef NATIVE_GC
+	mf->id = ++next_id;
+  #endif
   }
 
-#else
+#else /* MR_NEW_MERCURYFILE_STRUCT */
 
   void
   MR_mercuryfile_init(FILE *file, int line_number, MercuryFile *mf)
@@ -38,6 +45,9 @@
 	mf->getc		= MR_getch;
 	mf->vprintf		= MR_vfprintf;
 	mf->putc		= MR_putch;
+  #ifdef NATIVE_GC
+	mf->id = ++next_id;
+  #endif
   }
 
   int
-- 
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-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