From 62faafe4fd0cb113a4582989df34b5d40cde9219 Mon Sep 17 00:00:00 2001 From: Richard Kistruck Date: Thu, 20 Dec 2007 17:16:43 +0000 Subject: [PATCH] Mps br/vmarenagrow: arena.c: arenadescribe() now reports total arena reserved and committed (only the two most important things to know!). Transgression: This entails calling the ArenaReserved function. Copied from Perforce Change: 163663 ServerID: perforce.ravenbrook.com --- mps/code/arena.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mps/code/arena.c b/mps/code/arena.c index ff17ec5add1..a5ca9dbb19f 100644 --- a/mps/code/arena.c +++ b/mps/code/arena.c @@ -314,6 +314,7 @@ void ControlFinish(Arena arena) Res ArenaDescribe(Arena arena, mps_lib_FILE *stream) { Res res; + Size reserved; if (!CHECKT(Arena, arena)) return ResFAIL; if (stream == NULL) return ResFAIL; @@ -331,9 +332,21 @@ Res ArenaDescribe(Arena arena, mps_lib_FILE *stream) if (res != ResOK) return res; } + /* Note: this Describe clause calls a function */ + reserved = ArenaReserved(arena); res = WriteF(stream, - " commitLimit $W\n", (WriteFW)arena->commitLimit, - " spareCommitted $W\n", (WriteFW)arena->spareCommitted, + " reserved $W <-- " + "total size of address-space reserved\n", + (WriteFW)reserved, + NULL); + if (res != ResOK) return res; + + res = WriteF(stream, + " committed $W <-- " + "total bytes currently stored (in RAM or swap)\n", + (WriteFW)arena->committed, + " commitLimit $W\n", (WriteFW)arena->commitLimit, + " spareCommitted $W\n", (WriteFW)arena->spareCommitted, " spareCommitLimit $W\n", (WriteFW)arena->spareCommitLimit, " zoneShift $U\n", (WriteFU)arena->zoneShift, " alignment $W\n", (WriteFW)arena->alignment,