? stringpool.diff
Index: ut_pool.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_pool.cpp,v
retrieving revision 1.7
diff -u -r1.7 ut_pool.cpp
--- ut_pool.cpp	1999/12/19 00:41:22	1.7
+++ ut_pool.cpp	2000/07/17 23:01:08
@@ -24,12 +24,12 @@
 
 #include "ut_pool.h"
 
-#define UT_POOL_BUCKET_SIZE		1024
+#define UT_POOL_MIN_BUCKET_SIZE		1024
 
 UT_StringPool::UT_StringPool()
 {
 	m_pFirstBucket = NULL;
-	addBucket();
+	addBucket(UT_POOL_MIN_BUCKET_SIZE);
 }
 
 UT_StringPool::~UT_StringPool()
@@ -57,9 +57,9 @@
 	delete [] pChars;
 }
 
-int UT_StringPool::addBucket()
+int UT_StringPool::addBucket(int n)
 {
-	UT_PoolBucket* pBuck = new UT_PoolBucket(1024);
+	UT_PoolBucket* pBuck = new UT_PoolBucket(n);
 	pBuck->pNext = m_pFirstBucket;
 	m_pFirstBucket = pBuck;
 
@@ -69,10 +69,13 @@
 char* UT_StringPool::addString(const char* p)
 {
 	int len = strlen(p);
+	int	n	= m_pFirstBucket->iCurLen + len + 1;
 
-	if ((m_pFirstBucket->iCurLen + len + 1) > m_pFirstBucket->iSpace)
+	if (n > m_pFirstBucket->iSpace)
 	{
-		if (0 != addBucket())
+		if (n < UT_POOL_MIN_BUCKET_SIZE)
+			n = UT_POOL_MIN_BUCKET_SIZE;
+		if (0 != addBucket(n))
 		{
 			return NULL; // out of mem
 		}
Index: ut_pool.h
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_pool.h,v
retrieving revision 1.6
diff -u -r1.6 ut_pool.h
--- ut_pool.h	1998/10/26 15:59:16	1.6
+++ ut_pool.h	2000/07/17 23:01:08
@@ -32,7 +32,7 @@
 	char* addString(const char*);
 
 protected:
-	int	addBucket();
+	int	addBucket(int);
 
 	struct UT_PoolBucket
 	{
