[m-rev.] diff: mercury_prof.c/dword fix

Zoltan Somogyi zs at cs.mu.OZ.AU
Sat Dec 29 18:18:59 AEDT 2001


This fixes a bug in my recent change that prevents full installation.

Estimated hours taken: 0.2
Branches: main

runtime/mercury_prof.c:
	Fix some references to MR_Dwords that are only needed in .memprof
	grades. In the process lift a limit on the sizes of the integers
	it reports by using doubles instead.

Zoltan.

cvs diff: Diffing .
Index: mercury_prof.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_prof.c,v
retrieving revision 1.18
diff -u -b -r1.18 mercury_prof.c
--- mercury_prof.c	2001/12/27 07:25:23	1.18
+++ mercury_prof.c	2001/12/29 06:03:21
@@ -375,6 +375,7 @@
 {
 	if (node != NULL) {
 		MR_Dword cells, words;
+		double	 cells_double, words_double;
 
 		cells = node->counter.cells_at_period_start;
 		words = node->counter.words_at_period_start;
@@ -384,15 +385,13 @@
 		MR_add_two_dwords(words,
 			node->counter.words_since_period_start);
 
-		if (cells.high_word || words.high_word) {
-			fprintf(stderr, "Mercury runtime: memory profile "
-				"counter for `%s' overflowed\n",
-				node->name);
-		}
-		fprintf(words_fptr, "%ld %lu\n",
-			(long) node->addr, words.low_word);
-		fprintf(cells_fptr, "%ld %lu\n",
-			(long) node->addr, cells.low_word);
+		MR_convert_dword_to_double(words, words_double);
+		MR_convert_dword_to_double(cells, cells_double);
+
+		fprintf(words_fptr, "%ld %.0f\n",
+			(long) node->addr, words_double);
+		fprintf(cells_fptr, "%ld %.0f\n",
+			(long) node->addr, cells_double);
 
 		print_memory_node(words_fptr, cells_fptr, node->left);
 		print_memory_node(words_fptr, cells_fptr, node->right);
cvs diff: Diffing GETOPT
cvs diff: Diffing machdeps
--------------------------------------------------------------------------
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