mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
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
This commit is contained in:
parent
9d28437a57
commit
3540d21ee1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user