--------------------- PatchSet 3666 Date: 2006/09/03 03:10:10 Author: hno Branch: valgrind Tag: (none) Log: Clean up mempool usage etc. Members: src/cbdata.cc:1.23.4.2->1.23.4.3 src/helper.h:1.4->1.4.4.1 src/main.cc:1.71.4.1->1.71.4.2 src/mem.cc:1.32.4.1->1.32.4.2 src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc:1.7->1.7.4.1 src/DiskIO/DiskThreads/DiskThreadsIOStrategy.h:1.3->1.3.4.1 src/DiskIO/DiskThreads/aiops.cc:1.9->1.9.4.1 src/auth/digest/auth_digest.cc:1.27->1.27.4.1 src/auth/negotiate/auth_negotiate.cc:1.8->1.8.4.1 src/auth/ntlm/auth_ntlm.cc:1.30->1.30.4.1 src/fs/coss/StoreFScoss.cc:1.5->1.5.4.1 src/fs/coss/store_coss.h:1.12->1.12.4.1 src/fs/coss/store_dir_coss.cc:1.28->1.28.4.1 src/repl/lru/store_repl_lru.cc:1.7->1.7.4.1 test-suite/MemPoolTest.cc:1.2->1.2.16.1 Index: squid3/src/cbdata.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/cbdata.cc,v retrieving revision 1.23.4.2 retrieving revision 1.23.4.3 diff -u -r1.23.4.2 -r1.23.4.3 --- squid3/src/cbdata.cc 2 Sep 2006 22:05:52 -0000 1.23.4.2 +++ squid3/src/cbdata.cc 3 Sep 2006 03:10:10 -0000 1.23.4.3 @@ -1,6 +1,6 @@ /* - * $Id: cbdata.cc,v 1.23.4.2 2006/09/02 22:05:52 hno Exp $ + * $Id: cbdata.cc,v 1.23.4.3 2006/09/03 03:10:10 hno Exp $ * * DEBUG: section 45 Callback Data Registry * ORIGINAL AUTHOR: Duane Wessels @@ -81,6 +81,8 @@ class cbdata { + /* TODO: examine making cbdata templated on this - so we get type + * safe access to data - RBC 20030902 */ public: #if HASHED_CBDATA hash_link hash; // Must be first @@ -120,20 +122,15 @@ /* cookie used while debugging */ long cookie; - /* TODO: examine making cbdata templated on this - so we get type - * safe access to data - RBC 20030902 */ -#if !HASHED_CBDATA - /* MUST be the last per-instance member */ - void *data; -#endif -void check(int line) const {assert(cookie == ((long)this ^ Cookie));} - - size_t dataSize() const { return sizeof(data);} - + void check(int line) const {assert(cookie == ((long)this ^ Cookie));} static const long Cookie; + #if !HASHED_CBDATA + size_t dataSize() const { return sizeof(data);} static long MakeOffset(); static const long Offset; + /* MUST be the last per-instance member */ + void *data; #endif }; @@ -176,7 +173,7 @@ struct CBDataIndex { - MemAllocatorProxy *pool; + MemAllocator *pool; FREE *free_func; } @@ -212,8 +209,14 @@ FREE *free_func = cbdata_index[type].free_func; +#if HASHED_CBDATA + void *p = hash.key; +#else + void *p = &data; +#endif + if (free_func) - free_func(&data); + free_func(p); } static void @@ -235,7 +238,7 @@ size += cbdata::Offset; #endif - cbdata_index[type].pool = new MemAllocatorProxy(label, size); + cbdata_index[type].pool = MemPools::GetInstance().create(label, size); cbdata_index[type].free_func = free_func; @@ -355,14 +358,6 @@ dlinkDelete(&c->link, &cbdataEntries); #endif -#if HASHED_CBDATA - hash_remove_link(cbdata_htable, &c->hash); - cbdata_index[c->type].pool->free(p); - c->cbdata::~cbdata(); -#else - cbdata_type theType = c->type; - c->cbdata::~cbdata(); - /* This is ugly. But: operator delete doesn't get * the type parameter, so we can't use that * to free the memory. @@ -373,7 +368,13 @@ * we could use the normal delete operator * and it would Just Work. RBC 20030902 */ - assert ( cbdata_index[theType].pool ); + cbdata_type theType = c->type; +#if HASHED_CBDATA + hash_remove_link(cbdata_htable, &c->hash); + delete c; + cbdata_index[theType].pool->free((void *)p); +#else + c->cbdata::~cbdata(); cbdata_index[theType].pool->free(c); #endif return NULL; @@ -467,15 +468,6 @@ #endif -#if HASHED_CBDATA - hash_remove_link(cbdata_htable, &c->hash); - cbdata_index[c->type].pool->free((void *)p); - c->cbdata::~cbdata(); -#else - cbdata_type theType = c->type; - - c->cbdata::~cbdata(); - /* This is ugly. But: operator delete doesn't get * the type parameter, so we can't use that * to free the memory. @@ -486,6 +478,13 @@ * we could use the normal delete operator * and it would Just Work. RBC 20030902 */ + cbdata_type theType = c->type; +#if HASHED_CBDATA + hash_remove_link(cbdata_htable, &c->hash); + delete c; + cbdata_index[theType].pool->free((void *)p); +#else + c->cbdata::~cbdata(); cbdata_index[theType].pool->free(c); #endif } @@ -544,8 +543,13 @@ void cbdata::dump(StoreEntry *sentry) const { +#if HASHED_CBDATA + void *p = hash.key; +#else + void *p = &data; +#endif storeAppendPrintf(sentry, "%c%p\t%d\t%d\t%20s:%-5d\n", valid ? ' ' : - '!', &data, type, locks, file, line); + '!', p, type, locks, file, line); } struct CBDataDumper : public unary_function @@ -575,7 +579,7 @@ storeAppendPrintf(sentry, "types\tsize\tallocated\ttotal\n"); for (int i = 1; i < cbdata_types; i++) { - MemAllocatorProxy *pool = cbdata_index[i].pool; + MemAllocator *pool = cbdata_index[i].pool; if (pool) { #if HASHED_CBDATA Index: squid3/src/helper.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/helper.h,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -u -r1.4 -r1.4.4.1 --- squid3/src/helper.h 21 Aug 2006 01:51:49 -0000 1.4 +++ squid3/src/helper.h 3 Sep 2006 03:10:10 -0000 1.4.4.1 @@ -1,6 +1,6 @@ /* - * $Id: helper.h,v 1.4 2006/08/21 01:51:49 squidadm Exp $ + * $Id: helper.h,v 1.4.4.1 2006/09/03 03:10:10 hno Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -90,7 +90,7 @@ int n_running; int n_active; int ipc_type; - MemAllocatorProxy *datapool; + MemAllocator *datapool; HLPSAVAIL *IsAvailable; HLPSONEQ *OnEmptyQueue; time_t last_queue_warn; Index: squid3/src/main.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/main.cc,v retrieving revision 1.71.4.1 retrieving revision 1.71.4.2 diff -u -r1.71.4.1 -r1.71.4.2 --- squid3/src/main.cc 2 Sep 2006 22:05:52 -0000 1.71.4.1 +++ squid3/src/main.cc 3 Sep 2006 03:10:10 -0000 1.71.4.2 @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.71.4.1 2006/09/02 22:05:52 hno Exp $ + * $Id: main.cc,v 1.71.4.2 2006/09/03 03:10:10 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -408,9 +408,6 @@ case 'm': if (optarg) { - if (*optarg == 'c') { - MemPools::GetInstance().setDefaultPoolChunking(0); - } else { #if MALLOC_DBG malloc_debug_level = atoi(optarg); #else Index: squid3/src/mem.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/mem.cc,v retrieving revision 1.32.4.1 retrieving revision 1.32.4.2 diff -u -r1.32.4.1 -r1.32.4.2 --- squid3/src/mem.cc 2 Sep 2006 22:05:52 -0000 1.32.4.1 +++ squid3/src/mem.cc 3 Sep 2006 03:10:10 -0000 1.32.4.2 @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.32.4.1 2006/09/02 22:05:52 hno Exp $ + * $Id: mem.cc,v 1.32.4.2 2006/09/03 03:10:10 hno Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -142,7 +142,7 @@ if (RUNNING_ON_VALGRIND) { long int leaked = 0, dubious = 0, reachable = 0, suppressed = 0; stream << "Valgrind Report:\n"; - stream << "Type\tAmount\n"); + stream << "Type\tAmount\n"; debug(13, 1) ("Asking valgrind for memleaks\n"); VALGRIND_DO_LEAK_CHECK; debug(13, 1) ("Getting valgrind statistics\n"); Index: squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -u -r1.7 -r1.7.4.1 --- squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc 17 Jun 2006 16:50:44 -0000 1.7 +++ squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.cc 3 Sep 2006 03:10:11 -0000 1.7.4.1 @@ -1,6 +1,6 @@ /* - * $Id: DiskThreadsIOStrategy.cc,v 1.7 2006/06/17 16:50:44 squidadm Exp $ + * $Id: DiskThreadsIOStrategy.cc,v 1.7.4.1 2006/09/03 03:10:11 hno Exp $ * * DEBUG: section 79 Squid-side Disk I/O functions. * AUTHOR: Robert Collins @@ -43,15 +43,13 @@ #include "Store.h" #include "fde.h" -//static MemAllocatorProxy *squidaio_ctrl_pool; - void DiskThreadsIOStrategy::init(void) { if (initialised) return; - squidaio_ctrl_pool = new MemAllocatorProxy("aio_ctrl", sizeof(squidaio_ctrl_t)); + squidaio_ctrl_pool = MemPools::GetInstance().create("aio_ctrl", sizeof(squidaio_ctrl_t)); initialised = true; Index: squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.h,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -u -r1.3 -r1.3.4.1 --- squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.h 29 May 2006 00:50:19 -0000 1.3 +++ squid3/src/DiskIO/DiskThreads/DiskThreadsIOStrategy.h 3 Sep 2006 03:10:11 -0000 1.3.4.1 @@ -1,6 +1,6 @@ /* - * $Id: DiskThreadsIOStrategy.h,v 1.3 2006/05/29 00:50:19 squidadm Exp $ + * $Id: DiskThreadsIOStrategy.h,v 1.3.4.1 2006/09/03 03:10:11 hno Exp $ * * DEBUG: section 79 Squid-side Disk I/O functions. * AUTHOR: Robert Collins @@ -64,7 +64,7 @@ /* Todo: add access limitations */ bool initialised; static DiskThreadsIOStrategy Instance; - MemAllocatorProxy *squidaio_ctrl_pool; + MemAllocator *squidaio_ctrl_pool; private: static void aioStats(StoreEntry * sentry); Index: squid3/src/DiskIO/DiskThreads/aiops.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/DiskIO/DiskThreads/aiops.cc,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -u -r1.9 -r1.9.4.1 --- squid3/src/DiskIO/DiskThreads/aiops.cc 7 Aug 2006 02:51:15 -0000 1.9 +++ squid3/src/DiskIO/DiskThreads/aiops.cc 3 Sep 2006 03:10:11 -0000 1.9.4.1 @@ -1,5 +1,5 @@ /* - * $Id: aiops.cc,v 1.9 2006/08/07 02:51:15 squidadm Exp $ + * $Id: aiops.cc,v 1.9.4.1 2006/09/03 03:10:11 hno Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -143,15 +143,15 @@ #define AIO_TINY_BUFS AIO_LARGE_BUFS >> 3 #define AIO_MICRO_BUFS 128 -static MemAllocatorProxy *squidaio_large_bufs = NULL; /* 16K */ -static MemAllocatorProxy *squidaio_medium_bufs = NULL; /* 8K */ -static MemAllocatorProxy *squidaio_small_bufs = NULL; /* 4K */ -static MemAllocatorProxy *squidaio_tiny_bufs = NULL; /* 2K */ -static MemAllocatorProxy *squidaio_micro_bufs = NULL; /* 128K */ +static MemAllocator *squidaio_large_bufs = NULL; /* 16K */ +static MemAllocator *squidaio_medium_bufs = NULL; /* 8K */ +static MemAllocator *squidaio_small_bufs = NULL; /* 4K */ +static MemAllocator *squidaio_tiny_bufs = NULL; /* 2K */ +static MemAllocator *squidaio_micro_bufs = NULL; /* 128K */ static int request_queue_len = 0; -static MemAllocatorProxy *squidaio_request_pool = NULL; -static MemAllocatorProxy *squidaio_thread_pool = NULL; +static MemAllocator *squidaio_request_pool = NULL; +static MemAllocator *squidaio_thread_pool = NULL; static squidaio_request_queue_t request_queue; static struct @@ -181,33 +181,30 @@ #endif static pthread_t main_thread; -static MemAllocatorProxy * +static MemAllocator * squidaio_get_pool(int size) { - MemAllocatorProxy *p; - if (size <= AIO_LARGE_BUFS) { if (size <= AIO_MICRO_BUFS) - p = squidaio_micro_bufs; + return squidaio_micro_bufs; else if (size <= AIO_TINY_BUFS) - p = squidaio_tiny_bufs; + return squidaio_tiny_bufs; else if (size <= AIO_SMALL_BUFS) - p = squidaio_small_bufs; + return squidaio_small_bufs; else if (size <= AIO_MEDIUM_BUFS) - p = squidaio_medium_bufs; + return squidaio_medium_bufs; else - p = squidaio_large_bufs; - } else - p = NULL; + return squidaio_large_bufs; + } - return p; + return NULL; } void * squidaio_xmalloc(int size) { void *p; - MemAllocatorProxy *pool; + MemAllocator *pool; if ((pool = squidaio_get_pool(size)) != NULL) { p = pool->alloc(); @@ -232,7 +229,7 @@ void squidaio_xfree(void *p, int size) { - MemAllocatorProxy *pool; + MemAllocator *pool; if ((pool = squidaio_get_pool(size)) != NULL) { pool->free(p); @@ -243,7 +240,7 @@ static void squidaio_xstrfree(char *str) { - MemAllocatorProxy *pool; + MemAllocator *pool; int len = strlen(str) + 1; if ((pool = squidaio_get_pool(len)) != NULL) { @@ -326,7 +323,7 @@ done_queue.blocked = 0; /* Create threads and get them to sit in their wait loop */ - squidaio_thread_pool = new MemAllocatorProxy("aio_thread", sizeof(squidaio_thread_t)); + squidaio_thread_pool = MemPools::GetInstance().create("aio_thread", sizeof(squidaio_thread_t)); assert(NUMTHREADS); @@ -346,17 +343,17 @@ } /* Create request pool */ - squidaio_request_pool = new MemAllocatorProxy("aio_request", sizeof(squidaio_request_t)); + squidaio_request_pool = MemPools::GetInstance().create("aio_request", sizeof(squidaio_request_t)); - squidaio_large_bufs = new MemAllocatorProxy("squidaio_large_bufs", AIO_LARGE_BUFS); + squidaio_large_bufs = MemPools::GetInstance().create("squidaio_large_bufs", AIO_LARGE_BUFS); - squidaio_medium_bufs = new MemAllocatorProxy("squidaio_medium_bufs", AIO_MEDIUM_BUFS); + squidaio_medium_bufs = MemPools::GetInstance().create("squidaio_medium_bufs", AIO_MEDIUM_BUFS); - squidaio_small_bufs = new MemAllocatorProxy("squidaio_small_bufs", AIO_SMALL_BUFS); + squidaio_small_bufs = MemPools::GetInstance().create("squidaio_small_bufs", AIO_SMALL_BUFS); - squidaio_tiny_bufs = new MemAllocatorProxy("squidaio_tiny_bufs", AIO_TINY_BUFS); + squidaio_tiny_bufs = MemPools::GetInstance().create("squidaio_tiny_bufs", AIO_TINY_BUFS); - squidaio_micro_bufs = new MemAllocatorProxy("squidaio_micro_bufs", AIO_MICRO_BUFS); + squidaio_micro_bufs = MemPools::GetInstance().create("squidaio_micro_bufs", AIO_MICRO_BUFS); squidaio_initialised = 1; } Index: squid3/src/auth/digest/auth_digest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/digest/auth_digest.cc,v retrieving revision 1.27 retrieving revision 1.27.4.1 diff -u -r1.27 -r1.27.4.1 --- squid3/src/auth/digest/auth_digest.cc 7 Aug 2006 02:51:15 -0000 1.27 +++ squid3/src/auth/digest/auth_digest.cc 3 Sep 2006 03:10:11 -0000 1.27.4.1 @@ -1,6 +1,6 @@ /* - * $Id: auth_digest.cc,v 1.27 2006/08/07 02:51:15 squidadm Exp $ + * $Id: auth_digest.cc,v 1.27.4.1 2006/09/03 03:10:11 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -63,7 +63,7 @@ static AuthDigestConfig digestConfig; static int authdigest_initialised = 0; -static MemAllocatorProxy *digest_nonce_pool = NULL; +static MemAllocator *digest_nonce_pool = NULL; CBDATA_TYPE(DigestAuthenticateStateData); @@ -201,7 +201,7 @@ authenticateDigestNonceSetup(void) { if (!digest_nonce_pool) - digest_nonce_pool = new MemAllocatorProxy("Digest Scheme nonce's", sizeof(digest_nonce_h)); + digest_nonce_pool = MemPools::GetInstance().create("Digest Scheme nonce's", sizeof(digest_nonce_h)); if (!digest_nonce_cache) { digest_nonce_cache = hash_create((HASHCMP *) strcmp, 7921, hash_string); Index: squid3/src/auth/negotiate/auth_negotiate.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/negotiate/auth_negotiate.cc,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -u -r1.8 -r1.8.4.1 --- squid3/src/auth/negotiate/auth_negotiate.cc 7 Jul 2006 19:51:05 -0000 1.8 +++ squid3/src/auth/negotiate/auth_negotiate.cc 3 Sep 2006 03:10:11 -0000 1.8.4.1 @@ -1,6 +1,6 @@ /* - * $Id: auth_negotiate.cc,v 1.8 2006/07/07 19:51:05 squidadm Exp $ + * $Id: auth_negotiate.cc,v 1.8.4.1 2006/09/03 03:10:11 hno Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -70,8 +70,6 @@ static int authnegotiate_initialised = 0; -//static MemAllocatorProxy *negotiate_user_hash_pool = NULL; - static auth_negotiate_config negotiateConfig; static hash_table *proxy_auth_cache = NULL; @@ -175,14 +173,6 @@ AuthNegotiateConfig::init(AuthConfig * scheme) { if (authenticate) { -#if PLACEHOLDER - - if (!negotiate_user_hash_pool) - - negotiate_user_hash_pool = new MemAllocatorProxy("Negotiate Header Hash Data", sizeof(struct ProxyAuthCachePointer)); - -#endif - authnegotiate_initialised = 1; if (negotiateauthenticators == NULL) Index: squid3/src/auth/ntlm/auth_ntlm.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/ntlm/auth_ntlm.cc,v retrieving revision 1.30 retrieving revision 1.30.4.1 diff -u -r1.30 -r1.30.4.1 --- squid3/src/auth/ntlm/auth_ntlm.cc 7 Jul 2006 19:51:06 -0000 1.30 +++ squid3/src/auth/ntlm/auth_ntlm.cc 3 Sep 2006 03:10:11 -0000 1.30.4.1 @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.cc,v 1.30 2006/07/07 19:51:06 squidadm Exp $ + * $Id: auth_ntlm.cc,v 1.30.4.1 2006/09/03 03:10:11 hno Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -70,8 +70,6 @@ static int authntlm_initialised = 0; -//static MemAllocatorProxy *ntlm_user_hash_pool = NULL; - static auth_ntlm_config ntlmConfig; static hash_table *proxy_auth_cache = NULL; @@ -175,13 +173,6 @@ AuthNTLMConfig::init(AuthConfig * scheme) { if (authenticate) { -#if PLACEHOLDER - - if (!ntlm_user_hash_pool) - - ntlm_user_hash_pool = new MemAllocatorProxy("NTLM Header Hash Data", sizeof(struct ProxyAuthCachePointer)); - -#endif authntlm_initialised = 1; Index: squid3/src/fs/coss/StoreFScoss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/StoreFScoss.cc,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -u -r1.5 -r1.5.4.1 --- squid3/src/fs/coss/StoreFScoss.cc 29 May 2006 00:50:19 -0000 1.5 +++ squid3/src/fs/coss/StoreFScoss.cc 3 Sep 2006 03:10:12 -0000 1.5.4.1 @@ -1,6 +1,6 @@ /* - * $Id: StoreFScoss.cc,v 1.5 2006/05/29 00:50:19 squidadm Exp $ + * $Id: StoreFScoss.cc,v 1.5.4.1 2006/09/03 03:10:12 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Robert Collins @@ -79,7 +79,7 @@ { assert(!initialised); - coss_index_pool = new MemAllocatorProxy("COSS index data", sizeof(CossIndexNode)); + coss_index_pool = MemPools::GetInstance().create("COSS index data", sizeof(CossIndexNode)); initialised = true; } Index: squid3/src/fs/coss/store_coss.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_coss.h,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -u -r1.12 -r1.12.4.1 --- squid3/src/fs/coss/store_coss.h 22 May 2006 20:50:48 -0000 1.12 +++ squid3/src/fs/coss/store_coss.h 3 Sep 2006 03:10:12 -0000 1.12.4.1 @@ -98,8 +98,8 @@ /* Whether the coss system has been setup or not */ extern int coss_initialised; -extern MemAllocatorProxy *coss_membuf_pool; -extern MemAllocatorProxy *coss_index_pool; +extern MemAllocator *coss_membuf_pool; +extern MemAllocator *coss_index_pool; #include "DiskIO/ReadRequest.h" Index: squid3/src/fs/coss/store_dir_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_dir_coss.cc,v retrieving revision 1.28 retrieving revision 1.28.4.1 diff -u -r1.28 -r1.28.4.1 --- squid3/src/fs/coss/store_dir_coss.cc 19 Aug 2006 12:50:41 -0000 1.28 +++ squid3/src/fs/coss/store_dir_coss.cc 3 Sep 2006 03:10:12 -0000 1.28.4.1 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.28 2006/08/19 12:50:41 squidadm Exp $ + * $Id: store_dir_coss.cc,v 1.28.4.1 2006/09/03 03:10:12 hno Exp $ * vim: set et : * * DEBUG: section 47 Store COSS Directory Routines @@ -54,7 +54,7 @@ int n_coss_dirs = 0; /* static int last_coss_pick_index = -1; */ -MemAllocatorProxy *coss_index_pool = NULL; +MemAllocator *coss_index_pool = NULL; typedef struct _RebuildState RebuildState; Index: squid3/src/repl/lru/store_repl_lru.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/repl/lru/store_repl_lru.cc,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -u -r1.7 -r1.7.4.1 --- squid3/src/repl/lru/store_repl_lru.cc 21 Aug 2006 01:51:51 -0000 1.7 +++ squid3/src/repl/lru/store_repl_lru.cc 3 Sep 2006 03:10:12 -0000 1.7.4.1 @@ -1,6 +1,6 @@ /* - * $Id: store_repl_lru.cc,v 1.7 2006/08/21 01:51:51 squidadm Exp $ + * $Id: store_repl_lru.cc,v 1.7.4.1 2006/09/03 03:10:12 hno Exp $ * * DEBUG: section ? LRU Removal policy * AUTHOR: Henrik Nordstrom @@ -97,7 +97,7 @@ dlink_node node; }; -static MemPool *lru_node_pool = NULL; +static MemImplementingAllocator *lru_node_pool = NULL; static int nr_lru_policies = 0; static void @@ -334,7 +334,7 @@ if (!lru_node_pool) { /* Must be chunked */ - lru_node_pool = new MemPool("LRU policy node", sizeof(LruNode)); + lru_node_pool = MemPools::GetInstance().create("LRU policy node", sizeof(LruNode)); lru_node_pool->setChunkSize(512 * 1024); } Index: squid3/test-suite/MemPoolTest.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/test-suite/MemPoolTest.cc,v retrieving revision 1.2 retrieving revision 1.2.16.1 diff -u -r1.2 -r1.2.16.1 --- squid3/test-suite/MemPoolTest.cc 31 Aug 2004 02:14:30 -0000 1.2 +++ squid3/test-suite/MemPoolTest.cc 3 Sep 2006 03:10:13 -0000 1.2.16.1 @@ -1,5 +1,5 @@ /* - * $Id: MemPoolTest.cc,v 1.2 2004/08/31 02:14:30 squidadm Exp $ + * $Id: MemPoolTest.cc,v 1.2.16.1 2006/09/03 03:10:13 hno Exp $ * * AUTHOR: Robert Collins * @@ -54,13 +54,13 @@ }; static MemPool *Pool; }; -MemPool *MemPoolTest::Pool = NULL; +MemAllocator *MemPoolTest::Pool = NULL; void MemPoolTest::run() { assert (Pool == NULL); - Pool = new MemPool ("Test Pool", sizeof(SomethingToAlloc)); + Pool = MemPools::GetInstance().create("Test Pool", sizeof(SomethingToAlloc)); assert (Pool); SomethingToAlloc *something = static_cast(Pool->alloc()); assert (something);