A couple of additional parts of my change to add support for the

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.
This commit is contained in:
Fergus Henderson
2002-08-21 16:01:45 +00:00
parent 94f3e96ed1
commit c536e2516a
2 changed files with 13 additions and 5 deletions

View File

@@ -310,7 +310,9 @@ esac
case $gc_method in
accurate) GC_OPTS="-DMR_NATIVE_GC" ;;
boehm|conservative) GC_OPTS="-DMR_BOEHM_GC -DMR_CONSERVATIVE_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

View File

@@ -266,7 +266,7 @@ static const char mercury_funcs1[] =
"#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 @@ static const char mercury_funcs3[] =
"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"