diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-11-17 14:58:44 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-11-17 14:58:44 +0100 |
commit | de0938bc20ede6f83742edd65252287087eb9fef (patch) | |
tree | 4528e854d7fe5e477f0e786fb9bebcca0ab04114 /registry | |
parent | #i103496#: sandbox removed (diff) | |
download | core-de0938bc20ede6f83742edd65252287087eb9fef.tar.gz core-de0938bc20ede6f83742edd65252287087eb9fef.zip |
performance bug in build system caused by too many flushed
Diffstat (limited to 'registry')
-rw-r--r-- | registry/source/keyimpl.cxx | 8 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 22 | ||||
-rw-r--r-- | registry/source/regimpl.hxx | 2 | ||||
-rw-r--r-- | registry/source/registry.cxx | 2 |
4 files changed, 26 insertions, 8 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 281c8e27cbf0..b41fbbb5ada9 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -365,7 +365,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -424,7 +424,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -492,7 +492,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } @@ -560,7 +560,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p return REG_SET_VALUE_FAILED; } - rValue.flush(); + //rValue.flush(); rtl_freeMemory(pBuffer); return REG_NO_ERROR; } diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 8a4dd8b88ee9..b9edca734232 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -848,7 +848,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) { return REG_DELETE_KEY_FAILED; } - sFile.flush(); + //sFile.flush(); // set flag deleted !!! ((ORegKey*)hOldKey)->setDeleted(sal_True); @@ -894,7 +894,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey) { return REG_DELETE_VALUE_FAILED; } - ((OStoreFile&)pKey->getStoreFile()).flush(); + //((OStoreFile&)pKey->getStoreFile()).flush(); } _err = rStoreDir.next(iter); @@ -1065,7 +1065,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, { return REG_VALUE_NOT_EXISTS; } - pSourceKey->getStoreFile().flush(); + //pSourceKey->getStoreFile().flush(); pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE); @@ -1137,7 +1137,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, rtl_freeMemory(pBuffer); return REG_INVALID_VALUE; } - rTargetFile.flush(); + //rTargetFile.flush(); if (rwBytes != nSize) { @@ -1482,6 +1482,20 @@ RegError ORegistry::dumpRegistry(RegKeyHandle hKey) const return REG_NO_ERROR; } +RegError ORegistry::flush() +{ + REG_GUARD(m_mutex); + + if (m_file.isValid()) + { + m_file.flush(); + return REG_NO_ERROR; + } else + { + return REG_REGISTRY_NOT_EXISTS; + } +} + //********************************************************************* // dumpValue() diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx index c32dcf3527df..32baf9cc6ed5 100644 --- a/registry/source/regimpl.hxx +++ b/registry/source/regimpl.hxx @@ -113,6 +113,8 @@ public: RegError dumpRegistry(RegKeyHandle hKey) const; + RegError flush(); + ~ORegistry(); sal_Bool isReadOnly() const diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index cb145b3910c2..139646f7cdc7 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -430,6 +430,8 @@ static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg, */ _ret = pKey->closeKey(pNewKey); + if (_ret == REG_NO_ERROR ) + _ret = pReg->flush(); return _ret; } |