Cache changes, bug fixes, etc.

git-svn-id: svn://10.0.0.236/trunk@16020 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gagan%netscape.com
1998-12-09 02:43:16 +00:00
parent 0012f434c9
commit 2bd31be77d
4 changed files with 21 additions and 10 deletions

View File

@@ -138,6 +138,10 @@ PRBool nsDiskModule::AddObject(nsCacheObject* io_pObject)
if (io_pObject->Address())
{
MonitorLocker ml(this);
//Remove the earliar copy- silently handles if not found
Remove(io_pObject->Address());
// TODO optimize these further- make static - Gagan
DBT* key = PR_NEW(DBT);
DBT* data = PR_NEW(DBT);
@@ -415,6 +419,11 @@ PRBool nsDiskModule::Remove(nsCacheObject* pObject)
{
--m_Entries;
m_SizeInUse -= pObject->Size();
if (-1 == (*m_pDB->sync)(m_pDB, 0))
{
//Failed to sync database
PR_ASSERT(0);
}
}
//Remove it from the recently used list