[m-rev.] for review: fix bug in runtime/mercury_prof.c

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Dec 29 18:24:24 AEDT 2001


Zoltan, your recent change to the handling of MR_Dword
test case caused failures on ceres in grade hl.gc.memprof.
I think the following should make the error go away,
but I'm not sure if this is the right fix.

----------

Estimated hours taken: 1
Branches: main

runtime/mercury_prof.c:
	Fix a bug where the code didn't compile
	when MR_INT_LEAST64_TYPE was defined.

Workspace: /home/earth/fjh/ws-earth4/mercury
Index: runtime/mercury_prof.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_prof.c,v
retrieving revision 1.18
diff -u -d -r1.18 mercury_prof.c
--- runtime/mercury_prof.c	27 Dec 2001 07:25:23 -0000	1.18
+++ runtime/mercury_prof.c	29 Dec 2001 07:21:27 -0000
@@ -384,15 +384,23 @@
 		MR_add_two_dwords(words,
 			node->counter.words_since_period_start);
 
+/* XXX is this right? */
+#ifdef MR_INT_LEAST64_TYPE
+		fprintf(words_fptr, "%ld %lu\n",
+			(long) node->addr, (unsigned long) words);
+		fprintf(cells_fptr, "%ld %lu\n",
+			(long) node->addr, (unsigned long) cells);
+#else
 		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);
+			(long) node->addr, (unsigned long) words.low_word);
 		fprintf(cells_fptr, "%ld %lu\n",
-			(long) node->addr, cells.low_word);
+			(long) node->addr, (unsigned long) cells.low_word);
+#endif
 
 		print_memory_node(words_fptr, cells_fptr, node->left);
 		print_memory_node(words_fptr, cells_fptr, node->right);

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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