[m-dev.] for review: print C stack depth in report_stats
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Dec 6 23:44:16 AEDT 1999
Estimated hours taken: 0.5
library/benchmarking.m:
Add code to `report_stats' to print out the size of the C stack.
The code I've added only does this if conservative GC is enabled,
since it uses `GC_stackbottom', which only exists if we have
conservative GC enabled.
Workspace: /d-drive/home/hg/fjh/mercury
Index: library/benchmarking.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/benchmarking.m,v
retrieving revision 1.27
diff -u -d -r1.27 benchmarking.m
--- library/benchmarking.m 1999/11/22 04:25:55 1.27
+++ library/benchmarking.m 1999/12/06 12:32:27
@@ -164,6 +164,13 @@
eng->context.nondetstack_zone->min) / 1024.0
);
+#ifdef CONSERVATIVE_GC
+ { char local_var;
+ fprintf(stderr, "" C Stack: %.3fk,"",
+ labs(&local_var - (char *) GC_stackbottom) / 1024.0);
+ }
+#endif
+
#ifdef MR_USE_TRAIL
fprintf(stderr,
"" Trail: %.3fk,"",
--
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.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list