From c55ee551f806eabd9eb0ca6f501921c08cbda980 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 25 Apr 2001 01:35:47 +0000 Subject: Changed allocation growth factor to double when it gets less than a sixth of the buffer size instead of a quarter as this means worst case wasted space of one quarter rather than one third at little cost in time. --- src/CellBuffer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 56dd27ea0..56aa15215 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -628,7 +628,7 @@ void CellBuffer::RoomFor(int insertionLength) { if (gaplen <= insertionLength) { //Platform::DebugPrintf("need room %d %d\n", gaplen, insertionLength); GapTo(length); - if (growSize * 4 < size) + if (growSize * 6 < size) growSize *= 2; int newSize = size + insertionLength + growSize; //Platform::DebugPrintf("moved gap %d\n", newSize); -- cgit v1.2.3