From 0aae457a4a648ca217b28f9faa25d6c1df148aa5 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Fri, 12 Aug 2005 00:59:49 +0000 Subject: [PATCH] (st_flush): Increase buffer by 1.5x when growing, to avoid lots of copying where previoulsy growing by only 80 bytes at a time. --- libguile/strports.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/strports.c b/libguile/strports.c index 19e6e0f9a..af1928ce3 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,1999,2000,2001,2005 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -133,7 +133,7 @@ st_flush (SCM port) if (pt->write_pos == pt->write_end) { - st_resize_port (pt, pt->write_buf_size + SCM_WRITE_BLOCK); + st_resize_port (pt, pt->write_buf_size * 3 / 2 + SCM_WRITE_BLOCK); } pt->read_pos = pt->write_pos; if (pt->read_pos > pt->read_end)