diff options
author | Jilles Tjoelker <jilles@irssi.org> | 2008-06-19 21:57:52 +0000 |
---|---|---|
committer | jilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-06-19 21:57:52 +0000 |
commit | 3540d21ee159af05cba04d1e0109fc03a3e9cd71 (patch) | |
tree | fdf1f317b426a9ff35e8cf990a4e3242cc3b310c /src | |
parent | 9d28437a577057c67f1d632a4bee4d7310822589 (diff) | |
download | irssi-3540d21ee159af05cba04d1e0109fc03a3e9cd71.zip |
Include various overheads in /sb status memory count.
Overheads caused by the "view" cache are not included.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4864 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-text/textbuffer-commands.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/fe-text/textbuffer-commands.c b/src/fe-text/textbuffer-commands.c index 78d7e003..a89c1f51 100644 --- a/src/fe-text/textbuffer-commands.c +++ b/src/fe-text/textbuffer-commands.c @@ -330,28 +330,31 @@ static void cmd_scrollback_redraw(void) static void cmd_scrollback_status(void) { GSList *tmp; - int window_kb, total_lines, total_kb; + int total_lines; + size_t window_mem, total_mem; - total_lines = 0; total_kb = 0; + total_lines = 0; total_mem = 0; for (tmp = windows; tmp != NULL; tmp = tmp->next) { WINDOW_REC *window = tmp->data; TEXT_BUFFER_VIEW_REC *view; view = WINDOW_GUI(window)->view; - window_kb = g_slist_length(view->buffer->text_chunks)* - LINE_TEXT_CHUNK_SIZE/1024; + window_mem = sizeof(TEXT_BUFFER_REC); + window_mem += g_slist_length(view->buffer->text_chunks) * + sizeof(TEXT_CHUNK_REC); + window_mem += view->buffer->lines_count * sizeof(LINE_REC); total_lines += view->buffer->lines_count; - total_kb += window_kb; + total_mem += window_mem; printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "Window %d: %d lines, %dkB of data", window->refnum, view->buffer->lines_count, - window_kb); + (int)(window_mem / 1024)); } printtext(NULL, NULL, MSGLEVEL_CLIENTCRAP, "Total: %d lines, %dkB of data", - total_lines, total_kb); + total_lines, (int)(total_mem / 1024)); } static void sig_away_changed(SERVER_REC *server) |