diff: runtime/memory.c bug fix

Fergus Henderson fjh at cs.mu.oz.au
Wed Jun 11 17:01:57 AEST 1997


runtime/memory.c:
	Fix a conditional compilation bug that prevented the source code
	from compiling on Windows 95.  The code in dump_memory() was
	referring to `hardmax' even when HAVE_MPROTECT was not true.

Index: memory.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/memory.c,v
retrieving revision 1.70
diff -u -r1.70 memory.c
--- memory.c	1997/05/29 08:09:13	1.70
+++ memory.c	1997/06/11 06:55:31
@@ -304,10 +304,14 @@
   #endif /* HAVE_SIGINFO */
 		fprintf(stderr, "%-16s#%d-hardmax		= %p\n",
 			zone->name, zone->id, (void *) zone->hardmax);
-#endif /* HAVE_MPROTECT */
 		fprintf(stderr, "%-16s#%d-size		= %lu\n",
 			zone->name, zone->id, (unsigned long)
 			((char *)zone->hardmax - (char *)zone->min));
+#else
+		fprintf(stderr, "%-16s#%d-size		= %lu\n",
+			zone->name, zone->id, (unsigned long)
+			((char *)zone->top - (char *)zone->min));
+#endif /* HAVE_MPROTECT */
 		fprintf(stderr, "\n");
 	}
 }

-- 
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