[m-rev.] diff: options to control minimal model stack sizes

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon May 9 18:04:44 AEST 2005


runtime/Mmakefile:
	Add check for misspelt autoconf variable names.

runtime/mercury_wrapper.c:
	Add a mechanism for configuring the sizes of the stacks involved in
	minimal model tabling from the MERCURY_OPTIONS environment variable.

	Conform to our coding standards for braces in if-then-elses.

doc/user_guide.texi:
	Document the new options.

Zoltan.

cvs diff: Diffing runtime
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.121
diff -u -b -r1.121 Mmakefile
--- runtime/Mmakefile	6 May 2005 08:42:22 -0000	1.121
+++ runtime/Mmakefile	6 May 2005 08:52:08 -0000
@@ -361,6 +361,8 @@
 
 mercury_conf.h.date: $(MERCURY_DIR)/config.status mercury_conf.h.in
 	$(MERCURY_DIR)/config.status --header=mercury_conf.h
+	# check to ensure there were no mispelt autoconf variable names
+	if grep -n '[^$$]@' mercury_conf.h; then false; else true; fi
 	echo datestamp > mercury_conf.h.date
 
 mercury_conf.h: mercury_conf.h.date
Index: runtime/mercury_wrapper.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.147
diff -u -b -r1.147 mercury_wrapper.c
--- runtime/mercury_wrapper.c	29 Apr 2005 01:03:17 -0000	1.147
+++ runtime/mercury_wrapper.c	8 May 2005 11:01:48 -0000
@@ -994,6 +994,9 @@
 	MR_TRAIL_REDZONE_SIZE,
 	MR_HEAP_MARGIN_SIZE,
 	MR_HEAP_EXPANSION_FACTOR,
+	MR_GENSTACK_SIZE,
+	MR_CUTSTACK_SIZE,
+	MR_PNEGSTACK_SIZE,
 	MR_GEN_DETSTACK_SIZE,
 	MR_GEN_NONSTACK_SIZE,
 	MR_GEN_DETSTACK_REDZONE_SIZE,
@@ -1027,6 +1030,9 @@
 	{ "trail-redzone-size", 	1, 0, MR_TRAIL_REDZONE_SIZE },
 	{ "heap-margin-size", 		1, 0, MR_HEAP_MARGIN_SIZE },
 	{ "heap-expansion-factor", 	1, 0, MR_HEAP_EXPANSION_FACTOR },
+	{ "genstack-size", 		1, 0, MR_GENSTACK_SIZE },
+	{ "cutstack-size", 		1, 0, MR_CUTSTACK_SIZE },
+	{ "pnegstack-size", 		1, 0, MR_PNEGSTACK_SIZE },
 	{ "gen-detstack-size", 		1, 0, MR_GEN_DETSTACK_SIZE },
 	{ "gen-nonstack-size", 		1, 0, MR_GEN_NONSTACK_SIZE },
 	{ "gen-detstack-zone-size", 	1, 0, MR_GEN_DETSTACK_REDZONE_SIZE },
@@ -1061,114 +1067,153 @@
 		{
 
 		case MR_HEAP_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_heap_size = size;
 			break;
 
 		case MR_DETSTACK_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_detstack_size = size;
 			break;
 
 		case MR_NONDETSTACK_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_nondstack_size = size;
 			break;
 
 		case MR_SOLUTIONS_HEAP_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_solutions_heap_size = size;
 			break;
 
 		case MR_TRAIL_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_trail_size = size;
 			break;
 
 		case MR_HEAP_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_heap_zone_size = size;
 			break;
 
 		case MR_DETSTACK_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_detstack_zone_size = size;
 			break;
 
 		case MR_NONDETSTACK_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_nondstack_zone_size = size;
 			break;
 
 		case MR_SOLUTIONS_HEAP_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_solutions_heap_zone_size = size;
 			break;
 
 		case MR_TRAIL_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_trail_zone_size = size;
 			break;
 
 		case MR_HEAP_MARGIN_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_heap_margin_size = size;
 			break;
 
 		case MR_HEAP_EXPANSION_FACTOR:
-			if (sscanf(MR_optarg, "%lf", &MR_heap_expansion_factor)
-					!= 1)
+			if (sscanf(MR_optarg, "%lf",
+				&MR_heap_expansion_factor) != 1)
 			{
 				usage();
 			}
 			break;
 
+		case MR_GENSTACK_SIZE:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_genstack_size = size;
+			break;
+
+		case MR_CUTSTACK_SIZE:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_cutstack_size = size;
+			break;
+
+		case MR_PNEGSTACK_SIZE:
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
+				usage();
+			}
+
+			MR_pnegstack_size = size;
+			break;
+
 		case MR_GEN_DETSTACK_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_gen_detstack_size = size;
 			break;
 
 		case MR_GEN_NONSTACK_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_gen_nonstack_size = size;
 			break;
 
 		case MR_GEN_DETSTACK_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_gen_detstack_zone_size = size;
 			break;
 
 		case MR_GEN_NONSTACK_REDZONE_SIZE:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_gen_nonstack_zone_size = size;
 			break;
@@ -1197,8 +1242,9 @@
 
 		case 'n':
 		case MR_NUM_OUTPUT_ARGS:
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_num_output_args = size;
 			break;
@@ -1260,8 +1306,9 @@
 			break;
 
 		case 'C':
-			if (sscanf(MR_optarg, "%lu", &size) != 1)
+			if (sscanf(MR_optarg, "%lu", &size) != 1) {
 				usage();
+			}
 
 			MR_pcache_size = size * 1024;
 
@@ -1390,14 +1437,15 @@
 			MR_debug_enabled = MR_TRUE;
 			MR_debug_ever_enabled = MR_TRUE;
 
-			if (MR_streq(MR_optarg, "i"))
+			if (MR_streq(MR_optarg, "i")) {
 				MR_trace_handler = MR_TRACE_INTERNAL;
 #ifdef	MR_USE_EXTERNAL_DEBUGGER
-			else if (MR_streq(MR_optarg, "e"))
+			} else if (MR_streq(MR_optarg, "e")) {
 				MR_trace_handler = MR_TRACE_EXTERNAL;
 #endif
-			else
+			} else {
 				usage();
+			}
 
 			break;
 
@@ -1407,18 +1455,20 @@
 
 		case 'P':
 #ifdef	MR_THREAD_SAFE
-			if (sscanf(MR_optarg, "%u", &MR_num_threads) != 1)
+			if (sscanf(MR_optarg, "%u", &MR_num_threads) != 1) {
 				usage();
+			}
 
-			if (MR_num_threads < 1)
+			if (MR_num_threads < 1) {
 				usage();
-
+			}
 #endif
 			break;
 
 		case 'r':	
-			if (sscanf(MR_optarg, "%d", &repeats) != 1)
+			if (sscanf(MR_optarg, "%d", &repeats) != 1) {
 				usage();
+			}
 
 			break;
 
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.434
diff -u -b -r1.434 user_guide.texi
--- doc/user_guide.texi	5 May 2005 04:39:06 -0000	1.434
+++ doc/user_guide.texi	9 May 2005 08:02:24 -0000
@@ -7983,6 +7983,24 @@
 @cindex Trail size
 Sets the size of the trail to @var{size} kilobytes.
 
+ at sp 1
+ at item --genstack-size @var{size}
+ at findex --genstack-size
+ at cindex Generator stack size
+Sets the size of the generator stack to @var{size} kilobytes.
+
+ at sp 1
+ at item --cutstack-size @var{size}
+ at findex --cutstack-size
+ at cindex Cut stack size
+Sets the size of the cut stack to @var{size} kilobytes.
+
+ at sp 1
+ at item --pnegstack-size @var{size}
+ at findex --pnegstack-size
+ at cindex Pneg stack size
+Sets the size of the pneg stack to @var{size} kilobytes.
+
 @c @sp 1
 @c @item --heap-redzone-size @var{size}
 @c @findex --heap-redzone-size (runtime option)
--------------------------------------------------------------------------
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