trivial diff: fix profiling bug

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Apr 9 11:19:03 AEST 1999


Estimated hours taken: 0.75

runtime/mercury_prof_mem.c:
	Fix a stupid mistake in my previous change to make things
	Word-aligned.

Index: runtime/mercury_prof_mem.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_prof_mem.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_prof_mem.c
--- mercury_prof_mem.c	1999/04/06 14:53:02	1.4
+++ mercury_prof_mem.c	1999/04/09 01:16:14
@@ -65,7 +65,7 @@
 	** require stricter alignment than that, then you will need to
 	** change this to round the size up accordingly.
 	*/
-	size = (size + sizeof(Word) - 1) / sizeof(Word);
+	size = ((size + sizeof(Word) - 1) / sizeof(Word)) * sizeof(Word);
 
 	/* Here we waste a bit of space but hopefully not to much */
 	if (mem_left < size) {

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list