From 278dfd7f76860a9a7f2b51e658a1869e23caf7d2 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 30 May 2008 23:17:37 +0000 Subject: [PATCH] Reduce some memory waste in the scrollback buffer. Formerly, TEXT_CHUNK_REC was slightly more than a page. Due to glib changes (GMemChunk -> GSlice), this is now malloced directly, and many mallocs round up allocations larger than a page to page boundaries. On a whole this seems to save about 10%. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4853 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fe-text/textbuffer.h b/src/fe-text/textbuffer.h index da0e5f1c..2cfe536e 100644 --- a/src/fe-text/textbuffer.h +++ b/src/fe-text/textbuffer.h @@ -1,7 +1,9 @@ #ifndef __TEXTBUFFER_H #define __TEXTBUFFER_H -#define LINE_TEXT_CHUNK_SIZE 16384 +/* Make sure TEXT_CHUNK_REC is not slightly more than a page, as that + wastes a lot of memory. */ +#define LINE_TEXT_CHUNK_SIZE (16384 - 16) #define LINE_COLOR_BG 0x20 #define LINE_COLOR_DEFAULT 0x10