diff --git a/mozilla/mailnews/base/src/nsMsgFolderCache.cpp b/mozilla/mailnews/base/src/nsMsgFolderCache.cpp index 49f64536329..9d080c7d799 100644 --- a/mozilla/mailnews/base/src/nsMsgFolderCache.cpp +++ b/mozilla/mailnews/base/src/nsMsgFolderCache.cpp @@ -31,7 +31,6 @@ #include "nsXPIDLString.h" #include "nsMsgBaseCID.h" -#include "nsIArena.h" static NS_DEFINE_CID(kMorkCID, NS_MORK_CID); static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID); @@ -39,26 +38,6 @@ static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID); const char *kFoldersScope = "ns:msg:db:row:scope:folders:all"; // scope for all folders table const char *kFoldersTableKind = "ns:msg:db:table:kind:folders"; -class FolderCachePool : public nsIMdbHeap { // caller-supplied memory management interface -public: -// { ===== begin nsIMdbHeap methods ===== - virtual mdb_err Alloc(nsIMdbEnv* ev, // allocate a piece of memory - mdb_size inSize, // requested byte size of new memory block - void** outBlock); // memory block of inSize bytes, or nil - - virtual mdb_err Free(nsIMdbEnv* ev, // free block from Alloc or Resize() - void* ioBlock); // block to be destroyed/deallocated - - virtual mdb_err HeapAddStrongRef(nsIMdbEnv* ev); - virtual mdb_err HeapCutStrongRef(nsIMdbEnv* ev); - -// } ===== end nsIMdbHeap methods ===== - nsresult Init(); - virtual ~FolderCachePool() {}; -protected: - nsCOMPtr m_arena; -}; - nsMsgFolderCache::nsMsgFolderCache() { @@ -66,9 +45,6 @@ nsMsgFolderCache::nsMsgFolderCache() m_mdbStore = nsnull; NS_INIT_REFCNT(); m_mdbAllFoldersTable = nsnull; - m_morkEnvMemPool = new FolderCachePool; - if (m_morkEnvMemPool) - m_morkEnvMemPool->Init(); } // should this, could this be an nsCOMPtr ? @@ -90,7 +66,6 @@ nsMsgFolderCache::~nsMsgFolderCache() m_mdbEnv->CloseMdbObject(m_mdbEnv); // m_mdbEnv->CutStrongRef(m_mdbEnv); //??? is this right? } - delete m_morkEnvMemPool; } @@ -215,42 +190,13 @@ nsresult nsMsgFolderCache::InitExistingDB() return err; } -mdb_err FolderCachePool::Alloc(nsIMdbEnv* ev, // allocate a piece of memory - mdb_size inSize, // requested byte size of new memory block - void** outBlock) -{ - *outBlock = m_arena->Alloc(inSize); - return (*outBlock) ? 0 : (mdb_err) -1; -} - -mdb_err FolderCachePool::Free(nsIMdbEnv* ev, // free block from Alloc or Resize() - void* ioBlock) // block to be destroyed/deallocated -{ - return 0; -} - -mdb_err FolderCachePool::HeapAddStrongRef(nsIMdbEnv* ev) -{ - return 0; -} - -mdb_err FolderCachePool::HeapCutStrongRef(nsIMdbEnv* ev) -{ - return 0; -} - -nsresult FolderCachePool::Init() -{ - return NS_NewHeapArena(getter_AddRefs(m_arena), 1024); -} - nsresult nsMsgFolderCache::OpenMDB(const char *dbName, PRBool exists) { nsresult ret=NS_OK; nsIMdbFactory *myMDBFactory = GetMDBFactory(); if (myMDBFactory) { - ret = myMDBFactory->MakeEnv(m_morkEnvMemPool, &m_mdbEnv); + ret = myMDBFactory->MakeEnv(nsnull, &m_mdbEnv); if (NS_SUCCEEDED(ret)) { nsIMdbThumb *thumb = nsnull; diff --git a/mozilla/mailnews/base/src/nsMsgFolderCache.h b/mozilla/mailnews/base/src/nsMsgFolderCache.h index 5b62502477d..f180fc7dea1 100644 --- a/mozilla/mailnews/base/src/nsMsgFolderCache.h +++ b/mozilla/mailnews/base/src/nsMsgFolderCache.h @@ -30,8 +30,6 @@ #include "mdb.h" #include "nsHashtable.h" -class FolderCachePool; - class nsMsgFolderCache : public nsIMsgFolderCache { @@ -59,7 +57,6 @@ protected: nsFileSpec m_dbFileSpec; nsSupportsHashtable *m_cacheElements; - FolderCachePool *m_morkEnvMemPool; // mdb stuff nsIMdbEnv *m_mdbEnv; // to be used in all the db calls. nsIMdbStore *m_mdbStore;