[m-rev.] diff: fix compilation of low-level C grades on Windows

Julien Fischer jfischer at opturion.com
Wed Apr 30 12:10:57 AEST 2014


Fix a problem that broke low-level C grades on Windows.

runtime/mercury_debug.c:
 	Protect a reference to the memory zone hardmax with MR_PROTECTPAGE.

Julien.

diff --git a/runtime/mercury_debug.c b/runtime/mercury_debug.c
index b8fbe6f..691f529 100644
--- a/runtime/mercury_debug.c
+++ b/runtime/mercury_debug.c
@@ -896,8 +896,11 @@ MR_print_zone(FILE *fp, const MR_MemoryZone *zone)
      fprintf(fp, "zone %p:\n", zone);
      fprintf(fp, "  bottom %p, top %p\n",
          zone->MR_zone_bottom, zone->MR_zone_top);
-    fprintf(fp, "  min    %p, max %p, hardmax %p",
-        zone->MR_zone_min, zone->MR_zone_max, zone->MR_zone_hardmax);
+    fprintf(fp, "  min    %p, max %p",
+        zone->MR_zone_min, zone->MR_zone_max);
+#if defined(MR_PROTECTPAGE)
+    fprintf(fp, ", hardmax %p", zone->MR_zone_hardmax);
+#endif
  #if defined(MR_STACK_SEGMENTS) && !defined(MR_HIGHLEVEL_CODE)
      fprintf(fp, ", extend %p",
          zone->MR_zone_extend_threshold);



More information about the reviews mailing list