[m-dev.] for review: change default stack size

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Dec 14 20:00:37 AEDT 2000


The major drawback of this change is that it might break
some user's programs.  Comments?

----------

Estimated hours taken: 0.5

Change the default det stack size.

runtime/mercury_wrapper.c:
	Change the default det stack size to 512k, to match
	the documentation in the Mercury User's Guide.
	This will also improve performance for programs that
	don't use much memory, since currently the conservative
	garbage collector scans the whole of the det stack,
	including those parts which aren't used.

scripts/mmc.in:
	Override the default det stack size: set it to 4M.
	This is needed because the compiler itself uses a lot
	of stack space.

Workspace: /home/pgrad/fjh/ws/hg
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.82
diff -u -d -r1.82 mercury_wrapper.c
--- runtime/mercury_wrapper.c	2000/12/06 10:36:09	1.82
+++ runtime/mercury_wrapper.c	2000/12/14 08:52:21
@@ -55,7 +55,7 @@
 #else
   size_t	MR_heap_size =			4096;
 #endif
-size_t		MR_detstack_size =		4096;
+size_t		MR_detstack_size =		 512;
 size_t		MR_nondstack_size = 		 128;
 size_t		MR_solutions_heap_size =	1024;
 size_t		MR_global_heap_size =		1024;
Index: scripts/mmc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mmc.in,v
retrieving revision 1.15
diff -u -d -r1.15 mmc.in
--- scripts/mmc.in	2000/09/18 07:06:32	1.15
+++ scripts/mmc.in	2000/12/14 08:57:56
@@ -35,6 +35,11 @@
 HAVE_BOXED_FLOATS=@HAVE_BOXED_FLOATS@
 DEFAULT_OPT_LEVEL=${MERCURY_DEFAULT_OPT_LEVEL="-O2"}
 
+# The Mercury compiler uses more det stack space than the
+# default limit of 512k, so we need to override the default.
+MERCURY_OPTIONS="--det-stack-size 4096 $MERCURY_OPTIONS"
+export MERCURY_OPTIONS
+
 # XXX Temporary hack for bootstrapping purposes:
 # invoke $MC to test if it supports the --cflags-for-threads option.
 case "`$MC --cflags-for-threads </dev/null 2>&1`" in

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list