New dumpstack allocation diff

Andrew Bromage bromage at cs.mu.oz.au
Wed Apr 2 15:35:52 AEST 1997


G'day all.

A much simpler version of the previous change suggested by Zoltan.

Cheers,
Andrew Bromage
--------8<---CUT HERE---8<--------
Estimated hours taken: 1

Added code to define and allocate the dumpstack, thus allowing the
compiler to actually work in debug.* grades.

runtime/memory.c:
        Change init_heap() to allocate the dumpstack_zone.
        Change default_handler() to produce a detstack dump.

Index: memory.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/memory.c,v
retrieving revision 1.68
diff -u -r1.68 memory.c
--- memory.c    1997/03/06 02:50:55     1.68
+++ memory.c    1997/04/02 05:31:21
@@ -362,6 +362,13 @@
        solutions_heap_pointer = solutions_heap_zone->min;
 
 #endif
+
+#ifndef SPEED
+       /* Create the dumpstack, used for debugging stack traces. */
+
+       dumpstack_zone = create_zone("dumpstack", 1, detstack_size,
+                       next_offset(), detstack_zone_size, default_handler);
+#endif
 } /* end init_heap() */
 
 MemoryZone *
@@ -721,7 +728,7 @@
        }
        sprintf(buf, "\nMercury runtime: memory zone %s#%d overflowed\n",
                zone->name, zone->id);
-       fatal_abort(context, buf, FALSE);
+       fatal_abort(context, buf, TRUE);
     }
 
     return FALSE;




More information about the developers mailing list