mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 14:25:56 +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:
@@ -309,9 +309,11 @@ case $thread_safe in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $gc_method in
|
case $gc_method in
|
||||||
accurate) GC_OPTS="-DMR_NATIVE_GC" ;;
|
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" ;;
|
||||||
none) GC_OPTS="" ;;
|
conservative) GC_OPTS="-DMR_CONSERVATIVE_GC -DMR_BOEHM_GC" ;;
|
||||||
|
mps) GC_OPTS="-DMR_CONSERVATIVE_GC -DMR_MPS_GC" ;;
|
||||||
|
none) GC_OPTS="" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $profile_time in
|
case $profile_time in
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ static const char mercury_funcs1[] =
|
|||||||
"#endif\n"
|
"#endif\n"
|
||||||
"\n"
|
"\n"
|
||||||
"void\n"
|
"void\n"
|
||||||
"mercury_init(int argc, char **argv, char *stackbottom)\n"
|
"mercury_init(int argc, char **argv, void *stackbottom)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"\n"
|
"\n"
|
||||||
"#ifdef MR_CONSERVATIVE_GC\n"
|
"#ifdef MR_CONSERVATIVE_GC\n"
|
||||||
@@ -385,7 +385,13 @@ static const char mercury_funcs3[] =
|
|||||||
"int\n"
|
"int\n"
|
||||||
"mercury_main(int argc, char **argv)\n"
|
"mercury_main(int argc, char **argv)\n"
|
||||||
"{\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_init(argc, argv, &dummy);\n"
|
||||||
" mercury_call_main();\n"
|
" mercury_call_main();\n"
|
||||||
" return mercury_terminate();\n"
|
" return mercury_terminate();\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user