mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 05:44:58 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user