[m-rev.] trivial diff: fix MR_grade bug in last change

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 22 01:59:49 AEST 2002


On 22-Aug-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Sorry, I should have checked that my MPS changes didn't break the
> existing grades.  The following problem caused link errors
> (with MR_grade_* undefined) in *.gc grades.
> 
> scripts/mgnuc.in:
> 	Fix a bug in my previous change: handle the case where $gc_method
> 	is `boehm' rather than `conservative', and pass -DMR_BOEHM_GC
> 	as well as -DMR_CONSERVATIVE_GC.

Actually, that fix was not correct.
The correct one was in my original work-space, I just forgot to commit it.

----------

Estimated hours taken: 0.25
Branches: main

A couple of additional parts of my change to add support for the
MPS garbage collector which I forgot to commit in my previous change.

util/mkinit.c:
	Define the stack_bottom parameter of `mercury_init' to have type
	`void *' rather than `char *', and make sure that it is word-aligned.
	MPS requires that it be word-aligned.

scripts/mgnuc.in:
        Handle the new `mps' GC method.

Workspace: /home/earth/fjh/ws-earth3/mercury
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.89
diff -u -d -r1.89 mgnuc.in
--- scripts/mgnuc.in	21 Aug 2002 15:34:15 -0000	1.89
+++ scripts/mgnuc.in	21 Aug 2002 15:54:37 -0000
@@ -309,9 +309,11 @@
 esac
 
 case $gc_method in
-	accurate)		GC_OPTS="-DMR_NATIVE_GC" ;;
-	boehm|conservative)	GC_OPTS="-DMR_BOEHM_GC -DMR_CONSERVATIVE_GC" ;;
-	none)			GC_OPTS="" ;;
+	accurate)	GC_OPTS="-DMR_NATIVE_GC" ;;
+	boehm)		GC_OPTS="-DMR_CONSERVATIVE_GC -DMR_BOEHM_GC" ;;
+	conservative)	GC_OPTS="-DMR_CONSERVATIVE_GC -DMR_BOEHM_GC" ;;
+	mps)		GC_OPTS="-DMR_CONSERVATIVE_GC -DMR_MPS_GC" ;;
+	none)		GC_OPTS="" ;;
 esac
 
 case $profile_time in
Index: util/mkinit.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/mkinit.c,v
retrieving revision 1.86
diff -u -d -r1.86 mkinit.c
--- util/mkinit.c	18 Feb 2002 07:01:33 -0000	1.86
+++ util/mkinit.c	4 Aug 2002 13:36:28 -0000
@@ -266,7 +266,7 @@
 	"#endif\n"
 	"\n"
 	"void\n"
-	"mercury_init(int argc, char **argv, char *stackbottom)\n"
+	"mercury_init(int argc, char **argv, void *stackbottom)\n"
 	"{\n"
 	"\n"
 	"#ifdef MR_CONSERVATIVE_GC\n"
@@ -385,7 +385,13 @@
 	"int\n"
 	"mercury_main(int argc, char **argv)\n"
 	"{\n"
-	"	char dummy;\n"
+		/*
+		** Note that the address we use for the stack base
+		** needs to be word-aligned (the MPS GC requires this).
+		** That's why we give dummy the type `void *' rather than
+		** e.g. `char'.
+		*/
+	"	void *dummy;\n"
 	"	mercury_init(argc, argv, &dummy);\n"
 	"	mercury_call_main();\n"
 	"	return mercury_terminate();\n"
-- 
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