diff options
author | James Bursa <james@netsurf-browser.org> | 2006-12-03 22:34:26 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2006-12-03 22:34:26 +0000 |
commit | b6b768f52153f95ed96980b3eb019d9eec340b6c (patch) | |
tree | 3c343c9d7b3215a991fa2aa666ed0b163c8ab760 /riscos | |
parent | db0aae2a469d179fffbbbb83acb649214f5dd9ec (diff) | |
download | netsurf-b6b768f52153f95ed96980b3eb019d9eec340b6c.tar.gz netsurf-b6b768f52153f95ed96980b3eb019d9eec340b6c.tar.bz2 |
Improved tracking of memory usage. c->size is now exclusive of talloc size, and the two are added to find the full size.
svn path=/trunk/netsurf/; revision=3103
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/debugwin.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/riscos/debugwin.c b/riscos/debugwin.c index f01735893..dfdc3dfd3 100644 --- a/riscos/debugwin.c +++ b/riscos/debugwin.c @@ -2,7 +2,7 @@ * This file is part of NetSurf, http://netsurf-browser.org/ * Licensed under the GNU General Public License, * http://www.opensource.org/licenses/gpl-license - * Copyright 2004 James Bursa <bursa@users.sourceforge.net> + * Copyright 2006 James Bursa <bursa@users.sourceforge.net> */ /** \file @@ -16,6 +16,7 @@ #include "netsurf/riscos/dialog.h" #include "netsurf/riscos/wimp_event.h" #include "netsurf/utils/log.h" +#include "netsurf/utils/talloc.h" #include "netsurf/utils/utils.h" /** Update interval / cs. */ @@ -52,7 +53,7 @@ void ro_gui_debugwin_resize(void) box.x0 = 0; box.y0 = -count * 28; - box.x1 = 1200; + box.x1 = 1400; box.y1 = 0; error = xwimp_set_extent(dialog_debug, &box); if (error) { @@ -118,12 +119,13 @@ void ro_gui_debugwin_redraw(wimp_draw *redraw) void ro_gui_debugwin_redraw_plot(wimp_draw *redraw) { - char s[20]; + char s[40]; int x0 = redraw->box.x0 - redraw->xscroll; int y0 = redraw->box.y1 - redraw->yscroll; int i = 1; int y; unsigned int users; + unsigned int talloc_size; unsigned int size = 0; struct content *content; struct content_user *user; @@ -156,10 +158,12 @@ void ro_gui_debugwin_redraw_plot(wimp_draw *redraw) xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 960, y); xwimptextop_paint(0, content_status_name[content->status], x0 + 990, y); - snprintf(s, sizeof s, "%u", content->size); - xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 1190, y); - size += content->size; + talloc_size = talloc_total_size(content); + snprintf(s, sizeof s, "%u+%u=%u", content->size, talloc_size, + content->size + talloc_size); + xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 1390, y); + size += content->size + talloc_size; } snprintf(s, sizeof s, "%u", size); - xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 1190, y0 - i * 28 - 20); + xwimptextop_paint(wimptextop_RJUSTIFY, s, x0 + 1390, y0 - i * 28 - 20); } |