summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@irssi.org>2008-05-30 23:17:37 +0000
committerjilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564>2008-05-30 23:17:37 +0000
commit278dfd7f76860a9a7f2b51e658a1869e23caf7d2 (patch)
tree98cf99239a353217c44482e9711f4f0f40a2d2e7
parent7bf2ef0f6dcea9f9d8e83d9508e84b67e1a48c46 (diff)
downloadirssi-278dfd7f76860a9a7f2b51e658a1869e23caf7d2.zip
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
-rw-r--r--src/fe-text/textbuffer.h4
1 files changed, 3 insertions, 1 deletions
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