[m-rev.] for review: increase default detstack size

Mark Brown mark at cs.mu.OZ.AU
Thu Sep 1 18:20:42 AEST 2005


On 31-Aug-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Mark Brown, Wednesday, 31 August 2005:
> > On 31-Aug-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > > 
> > > This feels like a bad idea to me.
> > 
> > Can you elaborate?
> 
> I was thinking of reporting resource usage of programs in papers.  But
> thinking about it more, one pretty much expects to use twice the amount
> of space on a 64-bit machine, so I hereby recant my objection.

Here's the diff:

Estimated hours taken: 1
Branches: main

Make the default sizes of memory zones proportional to the word size.  None
of the default sizes change on a 32-bit architecture.

The rationale for this is that the amount of memory used by a Mercury program
for a given input is generally proportional to the word size.  Therefore,
before this change, a program that works on a 32-bit machine may overflow one
of the memory zones on a 64-bit machine unless special precautions are taken.
(In particular, the compiler cannot be bootchecked in asm_fast.gc.tr.debug
on a 64-bit machine without such a change.)

Add variants of size-setting options in the MERCURY_OPTIONS environment
variable that take kilo-words as the units.

runtime/mercury_wrapper.c:
	Modify the defaults and parse the new options.

	Add a comment that says the user guide should be updated if the
	defaults change.

doc/user_guide.texi:
	Update the documentation corresponding to this.  Also, fix some
	out-of-date numbers.

Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.451
diff -u -r1.451 user_guide.texi
--- doc/user_guide.texi	24 Aug 2005 09:07:09 -0000	1.451
+++ doc/user_guide.texi	31 Aug 2005 04:09:41 -0000
@@ -421,7 +421,8 @@
 @c XXX FIXME This is wrong for the case when --high-level-code is enabled.
 The det stack and the nondet stack
 are allocated fixed sizes at program start-up.
-The default size is 4096k for the det stack and 128k for the nondet stack,
+The default size is 1024k times the word size for the det stack
+and 64k times the word size for the nondet stack,
 but these can be overridden with the
 @samp{--detstack-size} and @samp{--nondetstack-size} options,
 @findex --detstack-size
@@ -439,7 +440,7 @@
 and will be dynamically expanded as needed,
 When not using conservative garbage collection,
 the heap has a fixed size like the stacks.
-The default size is 4 Mb, but this can be overridden
+The default size is 8Mb times the word size, but this can be overridden
 with the @samp{--heap-size} option.
 @cindex Heap size
 @cindex Heap overflow
@@ -8079,64 +8080,139 @@
 Sets the size of the heap to @var{size} kilobytes.
 
 @sp 1
+ at item --heap-size-kwords @var{size}
+ at findex --heap-size-kwords (runtime option)
+Sets the size of the heap to @var{size} kilobytes multiplied by the word size.
+
+ at sp 1
 @item --detstack-size @var{size}
 @findex --detstack-size (runtime option)
 Sets the size of the det stack to @var{size} kilobytes.
 
 @sp 1
+ at item --detstack-size-kwords @var{size}
+ at findex --detstack-size-kwords (runtime option)
+Sets the size of the det stack to @var{size} kilobytes
+multiplied by the word size.
+
+ at sp 1
 @item --nondetstack-size @var{size}
 @findex --nondetstack-size (runtime option)
 Sets the size of the nondet stack to @var{size} kilobytes.
 
 @sp 1
+ at item --nondetstack-size-kwords @var{size}
+ at findex --nondetstack-size-kwords (runtime option)
+Sets the size of the nondet stack to @var{size} kilobytes
+multiplied by the word size.
+
+ at sp 1
 @item --solutions-heap-size @var{size}
 @findex --solutions-heap-size (runtime option)
 Sets the size of the solutions heap to @var{size} kilobytes.
 
 @sp 1
+ at item --solutions-heap-size-kwords @var{size}
+ at findex --solutions-heap-size-kwords (runtime option)
+Sets the size of the solutions heap to @var{size} kilobytes
+multiplied by the word size.
+
+ at sp 1
 @item --trail-size @var{size}
 @findex --trail-size
 @cindex Trail size
 Sets the size of the trail to @var{size} kilobytes.
 
 @sp 1
+ at item --trail-size-kwords @var{size}
+ at findex --trail-size-kwords
+ at cindex Trail size
+Sets the size of the trail to @var{size} kilobytes
+multiplied by the word size.
+
+ at sp 1
 @item --genstack-size @var{size}
 @findex --genstack-size
 @cindex Generator stack size
 Sets the size of the generator stack to @var{size} kilobytes.
 
 @sp 1
+ at item --genstack-size-kwords @var{size}
+ at findex --genstack-size-kwords
+ at cindex Generator stack size
+Sets the size of the generator stack to @var{size} kilobytes
+multiplied by the word size.
+
+ at sp 1
 @item --cutstack-size @var{size}
 @findex --cutstack-size
 @cindex Cut stack size
 Sets the size of the cut stack to @var{size} kilobytes.
 
 @sp 1
+ at item --cutstack-size-kwords @var{size}
+ at findex --cutstack-size-kwords
+ at cindex Cut stack size
+Sets the size of the cut stack to @var{size} kilobytes
+multiplied by the word size.
+
+ at sp 1
 @item --pnegstack-size @var{size}
 @findex --pnegstack-size
 @cindex Pneg stack size
 Sets the size of the pneg stack to @var{size} kilobytes.
 
+ at sp 1
+ at item --pnegstack-size-kwords @var{size}
+ at findex --pnegstack-size-kwords
+ at cindex Pneg stack size
+Sets the size of the pneg stack to @var{size} kilobytes
+multiplied by the word size.
+
 @c @sp 1
 @c @item --heap-redzone-size @var{size}
 @c @findex --heap-redzone-size (runtime option)
 @c Sets the size of the redzone on the heap to @var{size} kilobytes.
 
 @c @sp 1
+ at c @item --heap-redzone-size-kwords @var{size}
+ at c @findex --heap-redzone-size-kwords (runtime option)
+ at c Sets the size of the redzone on the heap to @var{size} kilobytes
+ at c multiplied by the word size.
+
+ at c @sp 1
 @c @item --detstack-redzone-size @var{size}
 @c @findex --detstack-redzone-size (runtime option)
 @c Sets the size of the redzone on the det stack to @var{size} kilobytes.
 
 @c @sp 1
+ at c @item --detstack-redzone-size-kwords @var{size}
+ at c @findex --detstack-redzone-size-kwords (runtime option)
+ at c Sets the size of the redzone on the det stack to @var{size} kilobytes
+ at c multiplied by the word size.
+
+ at c @sp 1
 @c @item --nondetstack-redzone-size @var{size}
 @c @findex --nondetstack-redzone-size (runtime option)
 @c Sets the size of the redzone on the nondet stack to @var{size} kilobytes.
 
 @c @sp 1
+ at c @item --nondetstack-redzone-size-kwords @var{size}
+ at c @findex --nondetstack-redzone-size-kwords (runtime option)
+ at c Sets the size of the redzone on the nondet stack to @var{size} kilobytes
+ at c multiplied by the word size.
+
+ at c @sp 1
 @c @item --trail-redzone-size @var{size}
 @c @findex --trail-redzone-size (runtime option)
 @c Sets the size of the redzone on the trail to @var{size} kilobytes.
 
+ at c @sp 1
+ at c @item --trail-redzone-size-kwords @var{size}
+ at c @findex --trail-redzone-size-kwords (runtime option)
+ at c Sets the size of the redzone on the trail to @var{size} kilobytes
+ at c multiplied by the word size.
+
 @sp 1
 @item -i @var{filename}
 @itemx --mdb-in @var{filename}
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.151
diff -u -r1.151 mercury_wrapper.c
--- runtime/mercury_wrapper.c	29 Aug 2005 15:44:28 -0000	1.151
+++ runtime/mercury_wrapper.c	31 Aug 2005 05:20:26 -0000
@@ -77,35 +77,37 @@
 ** that we use will be twice the heap size specified here,
 ** since it is a two-space collector.
 **
-** Changes to MR_heap_size may also require changing MR_heap_zone_size
-** and/or the MR_heap_margin_size, which are defined below.
+** Changes to MR_heap_size, MR_detstack_size or MR_nondstack_size should
+** be reflected in the user guide.  Changes to MR_heap_size may also require
+** changing MR_heap_zone_size and/or the MR_heap_margin_size, which are
+** defined below.
 */
 #ifdef MR_DEBUG_AGC_SMALL_HEAP
-  size_t	MR_heap_size =			  52;
+  size_t	MR_heap_size =			  13 * sizeof(MR_Word);
 #else
-  size_t	MR_heap_size =		       32768; /* 32 Mb */
+  size_t	MR_heap_size =		        8192 * sizeof(MR_Word);
 #endif
-size_t		MR_detstack_size =		4096;
-size_t		MR_nondstack_size =	 	 256;
-size_t		MR_solutions_heap_size =	1024;
-size_t		MR_global_heap_size =		1024;
-size_t		MR_trail_size =			 128;
-size_t		MR_debug_heap_size =		4096;
-size_t		MR_genstack_size =		  32;
-size_t		MR_cutstack_size =		  32;
-size_t		MR_pnegstack_size =		  32;
-size_t		MR_gen_detstack_size =		  64;
-size_t		MR_gen_nonstack_size =		  64;
+size_t		MR_detstack_size =		1024 * sizeof(MR_Word);
+size_t		MR_nondstack_size =	 	  64 * sizeof(MR_Word);
+size_t		MR_solutions_heap_size =	 256 * sizeof(MR_Word);
+size_t		MR_global_heap_size =		 256 * sizeof(MR_Word);
+size_t		MR_trail_size =			  32 * sizeof(MR_Word);
+size_t		MR_debug_heap_size =		1024 * sizeof(MR_Word);
+size_t		MR_genstack_size =		   8 * sizeof(MR_Word);
+size_t		MR_cutstack_size =		   8 * sizeof(MR_Word);
+size_t		MR_pnegstack_size =		   8 * sizeof(MR_Word);
+size_t		MR_gen_detstack_size =		  16 * sizeof(MR_Word);
+size_t		MR_gen_nonstack_size =		  16 * sizeof(MR_Word);
 
 /*
 ** size of the redzones at the end of data areas, in kilobytes
 **
-** For accurate GC, although we start out with a big heap (32 Mb -- see above),
-** we don't want to touch all of it unless we really need to.
-** So with accurate GC in LLDS grades, we start out with a 28 Mb redzone,
-** leaving an active heap size of 4Mb.
-** The collector should (XXX it currently doesn't) resize this redzone
-** automatically at the end of each collection.
+** For accurate GC, although we start out with a big heap (32 Mb on 32-bit
+** architectures -- see above), we don't want to touch all of it unless we
+** really need to.  So with accurate GC in LLDS grades, we start out with
+** a 28 Mb redzone, leaving an active heap size of 4Mb.  The collector
+** should (XXX it currently doesn't) resize this redzone automatically at
+** the end of each collection.
 **
 ** For MLDS grades, we don't use redzones to schedule GC;
 ** instead GCs are scheduled, based on MR_heap_margin_size (see below),
@@ -113,24 +115,24 @@
 */
 #if defined(MR_NATIVE_GC) && !defined(MR_HIGHLEVEL_CODE)
   #ifdef MR_DEBUG_AGC_SMALL_HEAP
-    size_t		MR_heap_zone_size =	  32;
+    size_t		MR_heap_zone_size =	   8 * sizeof(MR_Word);
   #else
-    size_t		MR_heap_zone_size =	  16 + 28 * 1024;
+    size_t		MR_heap_zone_size =   (4 + 7 * 1024) * sizeof(MR_Word);
   #endif
 #else
-  size_t		MR_heap_zone_size =	  16;
+  size_t		MR_heap_zone_size =	   4 * sizeof(MR_Word);
 #endif
-size_t		MR_detstack_zone_size =		  16;
-size_t		MR_nondstack_zone_size =	  16;
-size_t		MR_solutions_heap_zone_size =	  16;
-size_t		MR_global_heap_zone_size =	  16;
-size_t		MR_trail_zone_size =		  16;
-size_t		MR_debug_heap_zone_size =	  16;
-size_t		MR_genstack_zone_size =		  16;
-size_t		MR_cutstack_zone_size =		  16;
-size_t		MR_pnegstack_zone_size =	  16;
-size_t		MR_gen_detstack_zone_size =	  16;
-size_t		MR_gen_nonstack_zone_size =	  16;
+size_t		MR_detstack_zone_size =		   4 * sizeof(MR_Word);
+size_t		MR_nondstack_zone_size =	   4 * sizeof(MR_Word);
+size_t		MR_solutions_heap_zone_size =	   4 * sizeof(MR_Word);
+size_t		MR_global_heap_zone_size =	   4 * sizeof(MR_Word);
+size_t		MR_trail_zone_size =		   4 * sizeof(MR_Word);
+size_t		MR_debug_heap_zone_size =	   4 * sizeof(MR_Word);
+size_t		MR_genstack_zone_size =		   4 * sizeof(MR_Word);
+size_t		MR_cutstack_zone_size =		   4 * sizeof(MR_Word);
+size_t		MR_pnegstack_zone_size =	   4 * sizeof(MR_Word);
+size_t		MR_gen_detstack_zone_size =	   4 * sizeof(MR_Word);
+size_t		MR_gen_nonstack_zone_size =	   4 * sizeof(MR_Word);
 
 /*
 ** MR_heap_margin_size is used for accurate GC with the MLDS->C back-end.
@@ -149,9 +151,9 @@
 ** (but we later multiply by 1024 to convert to bytes).
 */
 #ifdef MR_DEBUG_AGC_SMALL_HEAP
-  size_t	MR_heap_margin_size =		  16;
+  size_t	MR_heap_margin_size =		   4 * sizeof(MR_Word);
 #else
-  size_t	MR_heap_margin_size =		  28 * 1024;
+  size_t	MR_heap_margin_size =		   7 * 1024 * sizeof(MR_Word);
 #endif
 
 double MR_heap_expansion_factor = 2.0;
@@ -988,24 +990,42 @@
 
 enum MR_long_option {
 	MR_HEAP_SIZE,
+	MR_HEAP_SIZE_KWORDS,
 	MR_DETSTACK_SIZE,
+	MR_DETSTACK_SIZE_KWORDS,
 	MR_NONDETSTACK_SIZE,
+	MR_NONDETSTACK_SIZE_KWORDS,
 	MR_SOLUTIONS_HEAP_SIZE,
+	MR_SOLUTIONS_HEAP_SIZE_KWORDS,
 	MR_TRAIL_SIZE,
+	MR_TRAIL_SIZE_KWORDS,
 	MR_HEAP_REDZONE_SIZE,
+	MR_HEAP_REDZONE_SIZE_KWORDS,
 	MR_DETSTACK_REDZONE_SIZE,
+	MR_DETSTACK_REDZONE_SIZE_KWORDS,
 	MR_NONDETSTACK_REDZONE_SIZE,
+	MR_NONDETSTACK_REDZONE_SIZE_KWORDS,
 	MR_SOLUTIONS_HEAP_REDZONE_SIZE,
+	MR_SOLUTIONS_HEAP_REDZONE_SIZE_KWORDS,
 	MR_TRAIL_REDZONE_SIZE,
+	MR_TRAIL_REDZONE_SIZE_KWORDS,
 	MR_HEAP_MARGIN_SIZE,
+	MR_HEAP_MARGIN_SIZE_KWORDS,
 	MR_HEAP_EXPANSION_FACTOR,
 	MR_GENSTACK_SIZE,
+	MR_GENSTACK_SIZE_KWORDS,
 	MR_CUTSTACK_SIZE,
+	MR_CUTSTACK_SIZE_KWORDS,
 	MR_PNEGSTACK_SIZE,
+	MR_PNEGSTACK_SIZE_KWORDS,
 	MR_GEN_DETSTACK_SIZE,
+	MR_GEN_DETSTACK_SIZE_KWORDS,
 	MR_GEN_NONSTACK_SIZE,
+	MR_GEN_NONSTACK_SIZE_KWORDS,
 	MR_GEN_DETSTACK_REDZONE_SIZE,
+	MR_GEN_DETSTACK_REDZONE_SIZE_KWORDS,
 	MR_GEN_NONSTACK_REDZONE_SIZE,
+	MR_GEN_NONSTACK_REDZONE_SIZE_KWORDS,
 	MR_MDB_TTY,
 	MR_MDB_IN,
 	MR_MDB_OUT,
@@ -1025,24 +1045,47 @@
 
 struct MR_option MR_long_opts[] = {
 	{ "heap-size", 			1, 0, MR_HEAP_SIZE },
+	{ "heap-size-kwords",		1, 0, MR_HEAP_SIZE_KWORDS },
 	{ "detstack-size", 		1, 0, MR_DETSTACK_SIZE },
+	{ "detstack-size-kwords", 	1, 0, MR_DETSTACK_SIZE_KWORDS },
 	{ "nondetstack-size", 		1, 0, MR_NONDETSTACK_SIZE },
+	{ "nondetstack-size-kwords",	1, 0, MR_NONDETSTACK_SIZE_KWORDS },
 	{ "solutions-heap-size", 	1, 0, MR_SOLUTIONS_HEAP_SIZE },
+	{ "solutions-heap-size-kwords",	1, 0, MR_SOLUTIONS_HEAP_SIZE_KWORDS },
 	{ "trail-size", 		1, 0, MR_TRAIL_SIZE },
+	{ "trail-size-kwords", 		1, 0, MR_TRAIL_SIZE_KWORDS },
 	{ "heap-redzone-size", 		1, 0, MR_HEAP_REDZONE_SIZE },
+	{ "heap-redzone-size-kwords", 	1, 0, MR_HEAP_REDZONE_SIZE_KWORDS },
 	{ "detstack-redzone-size", 	1, 0, MR_DETSTACK_REDZONE_SIZE },
+	{ "detstack-redzone-size-kwords",
+			1, 0, MR_DETSTACK_REDZONE_SIZE_KWORDS },
 	{ "nondetstack-redzone-size", 	1, 0, MR_NONDETSTACK_REDZONE_SIZE },
+	{ "nondetstack-redzone-size-kwords",
+			1, 0, MR_NONDETSTACK_REDZONE_SIZE_KWORDS },
 	{ "solutions-heap-redzone-size",1, 0, MR_SOLUTIONS_HEAP_REDZONE_SIZE },
+	{ "solutions-heap-redzone-size-kwords",
+			1, 0, MR_SOLUTIONS_HEAP_REDZONE_SIZE_KWORDS },
 	{ "trail-redzone-size", 	1, 0, MR_TRAIL_REDZONE_SIZE },
+	{ "trail-redzone-size-kwords", 	1, 0, MR_TRAIL_REDZONE_SIZE_KWORDS },
 	{ "heap-margin-size", 		1, 0, MR_HEAP_MARGIN_SIZE },
+	{ "heap-margin-size-kwords", 	1, 0, MR_HEAP_MARGIN_SIZE_KWORDS },
 	{ "heap-expansion-factor", 	1, 0, MR_HEAP_EXPANSION_FACTOR },
 	{ "genstack-size", 		1, 0, MR_GENSTACK_SIZE },
+	{ "genstack-size-kwords", 	1, 0, MR_GENSTACK_SIZE_KWORDS },
 	{ "cutstack-size", 		1, 0, MR_CUTSTACK_SIZE },
+	{ "cutstack-size-kwords", 	1, 0, MR_CUTSTACK_SIZE_KWORDS },
 	{ "pnegstack-size", 		1, 0, MR_PNEGSTACK_SIZE },
+	{ "pnegstack-size-kwords", 	1, 0, MR_PNEGSTACK_SIZE_KWORDS },
 	{ "gen-detstack-size", 		1, 0, MR_GEN_DETSTACK_SIZE },
+	{ "gen-detstack-size-kwords", 	1, 0, MR_GEN_DETSTACK_SIZE_KWORDS },
 	{ "gen-nonstack-size", 		1, 0, MR_GEN_NONSTACK_SIZE },
+	{ "gen-nonstack-size-kwords", 	1, 0, MR_GEN_NONSTACK_SIZE_KWORDS },
 	{ "gen-detstack-zone-size", 	1, 0, MR_GEN_DETSTACK_REDZONE_SIZE },
+	{ "gen-detstack-zone-size-kwords",
+			1, 0, MR_GEN_DETSTACK_REDZONE_SIZE_KWORDS },
 	{ "gen-nonstack-zone-size", 	1, 0, MR_GEN_NONSTACK_REDZONE_SIZE },
+	{ "gen-nonstack-zone-size-kwords",
+			1, 0, MR_GEN_NONSTACK_REDZONE_SIZE_KWORDS },
 	{ "mdb-tty", 			1, 0, MR_MDB_TTY },
 	{ "mdb-in", 			1, 0, MR_MDB_IN },
 	{ "mdb-out", 			1, 0, MR_MDB_OUT },
@@ -1081,6 +1124,14 @@
 			MR_heap_size = size;
 			break;
 
+		case MR_HEAP_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_heap_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_DETSTACK_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1089,6 +1140,14 @@
 			MR_detstack_size = size;
 			break;
 
+		case MR_DETSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_detstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_NONDETSTACK_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1097,6 +1156,14 @@
 			MR_nondstack_size = size;
 			break;
 
+		case MR_NONDETSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_nondstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_SOLUTIONS_HEAP_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1105,6 +1172,14 @@
 			MR_solutions_heap_size = size;
 			break;
 
+		case MR_SOLUTIONS_HEAP_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_solutions_heap_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_TRAIL_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1113,6 +1188,14 @@
 			MR_trail_size = size;
 			break;
 
+		case MR_TRAIL_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_trail_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_HEAP_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1121,6 +1204,14 @@
 			MR_heap_zone_size = size;
 			break;
 
+		case MR_HEAP_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_heap_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_DETSTACK_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1129,6 +1220,14 @@
 			MR_detstack_zone_size = size;
 			break;
 
+		case MR_DETSTACK_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_detstack_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_NONDETSTACK_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1137,6 +1236,14 @@
 			MR_nondstack_zone_size = size;
 			break;
 
+		case MR_NONDETSTACK_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_nondstack_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_SOLUTIONS_HEAP_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1145,6 +1252,14 @@
 			MR_solutions_heap_zone_size = size;
 			break;
 
+		case MR_SOLUTIONS_HEAP_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_solutions_heap_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_TRAIL_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1153,6 +1268,14 @@
 			MR_trail_zone_size = size;
 			break;
 
+		case MR_TRAIL_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_trail_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_HEAP_MARGIN_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1161,6 +1284,14 @@
 			MR_heap_margin_size = size;
 			break;
 
+		case MR_HEAP_MARGIN_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_heap_margin_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_HEAP_EXPANSION_FACTOR:
 			if (sscanf(MR_optarg, "%lf",
 				&MR_heap_expansion_factor) != 1)
@@ -1177,6 +1308,14 @@
 			MR_genstack_size = size;
 			break;
 
+		case MR_GENSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_genstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_CUTSTACK_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1185,6 +1324,14 @@
 			MR_cutstack_size = size;
 			break;
 
+		case MR_CUTSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_cutstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_PNEGSTACK_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1193,6 +1340,14 @@
 			MR_pnegstack_size = size;
 			break;
 
+		case MR_PNEGSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_pnegstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_GEN_DETSTACK_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1201,6 +1356,14 @@
 			MR_gen_detstack_size = size;
 			break;
 
+		case MR_GEN_DETSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_gen_detstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_GEN_NONSTACK_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1209,6 +1372,14 @@
 			MR_gen_nonstack_size = size;
 			break;
 
+		case MR_GEN_NONSTACK_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_gen_nonstack_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_GEN_DETSTACK_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1217,6 +1388,14 @@
 			MR_gen_detstack_zone_size = size;
 			break;
 
+		case MR_GEN_DETSTACK_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_gen_detstack_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case MR_GEN_NONSTACK_REDZONE_SIZE:
 			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
@@ -1225,6 +1404,14 @@
 			MR_gen_nonstack_zone_size = size;
 			break;
 
+		case MR_GEN_NONSTACK_REDZONE_SIZE_KWORDS:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_gen_nonstack_zone_size = size * sizeof(MR_Word);
+			break;
+
 		case 'i':
 		case MR_MDB_IN:
 			MR_mdb_in_filename = MR_copy_string(MR_optarg);
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list