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 | b375b4a3f6c7c484af1a68cd2b74773ccff8457c (patch) | |
tree | 672dad4239e5c510e4dbb514a6c7f4014c5671d7 /registry | |
parent | a29626c811284582393921883ee0f2056f89e9cb (diff) |
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 6ddb9af66..bd21fae44 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 d60c4a4b1..5fd347dfe 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 57507674e..5e5b07384 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 ca3647df3..811057c4c 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; } |