Make it possible to initialise the Mercury runtime using an external interface

Branches: main

Make it possible to initialise the Mercury runtime using an external interface
without providing the address of the base of the stack.
This should work on most systems and can be useful when the top-level of a
program is not written in C or C++.
(In principle, this probably always worked, so the main change here is to
document it.)

util/mkinit.c:
	If mercury_init's stackbottom argument is NULL then don't
	set GC_stackbottom.

doc/user_guide.texi:
	Extend the description of the mercury_init function in the
	standalone-interfaces section to include the above.
This commit is contained in:
Julien Fischer
2012-01-11 04:58:12 +00:00
parent e107089ff0
commit f6dd75cc54
2 changed files with 9 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
** vim:sw=4 ts=4 expandtab
*/
/*
** Copyright (C) 1995-2008, 2010-2011 The University of Melbourne.
** Copyright (C) 1995-2008, 2010-2012 The University of Melbourne.
** This file may only be copied under the terms of the GNU General
** Public License - see the file COPYING in the Mercury distribution.
*/
@@ -380,11 +380,16 @@ static const char mercury_funcs1[] =
" ** GC knows where it starts. This is necessary for AIX 4.1\n"
" ** on RS/6000, and for gnu-win32 on Windows 95 or NT.\n"
" ** It may also be helpful on other systems.\n"
" ** For the Boehm GC, if the stackbottom argument is NULL then\n"
" ** do not explicitly register the bottom of the stack, but\n"
" ** let the collector determine an appropriate value itself.\n"
" */\n"
" #if defined(MR_HGC)\n"
" MR_hgc_set_stack_bot(stackbottom);\n"
" #elif defined(MR_BOEHM_GC)\n"
" GC_stackbottom = stackbottom;\n"
" if (stackbottom != NULL) {\n"
" GC_stackbottom = stackbottom;\n"
" }\n"
" #endif\n"
"#endif\n"
"\n"