diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-05 22:57:45 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-05 22:57:45 +0000 |
commit | 0cd6f180701a35abe5da0f4b0272b3047c03e330 (patch) | |
tree | b125489be5670eb775dd43f96236744eaedf9ef3 /plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h | |
parent | 56e1f721234e3f6d1ef3eb8cff2dc3f322c2b831 (diff) |
various speed optimizations
git-svn-id: http://svn.miranda-ng.org/main/trunk@12621 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h')
-rw-r--r-- | plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h b/plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h index 001c09a1d4..9a6beb1360 100644 --- a/plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h +++ b/plugins/Dbx_kyoto/src/kyotocabinet/kcdbext.h @@ -854,7 +854,7 @@ class IndexDB { * Default constructor. */ explicit IndexDB() : - mlock_(), db_(), omode_(0), + db_(), omode_(0), rcomp_(NULL), tmppath_(""), tmpdbs_(NULL), dbnum_(DEFDBNUM), dbclock_(0), cache_(NULL), csiz_(0), clim_(0) { _assert_(true); @@ -913,7 +913,7 @@ class IndexDB { bool open(const std::string& path = ":", uint32_t mode = BasicDB::OWRITER | BasicDB::OCREATE) { _assert_(true); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ != 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "already opened"); return false; @@ -1045,7 +1045,7 @@ class IndexDB { */ bool close() { _assert_(true); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1090,7 +1090,7 @@ class IndexDB { */ bool set(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz) { _assert_(kbuf && ksiz <= MEMMAXSIZ && vbuf && vsiz <= MEMMAXSIZ); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1126,7 +1126,7 @@ class IndexDB { */ bool add(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz) { _assert_(kbuf && ksiz <= MEMMAXSIZ && vbuf && vsiz <= MEMMAXSIZ); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1165,7 +1165,7 @@ class IndexDB { */ bool replace(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz) { _assert_(kbuf && ksiz <= MEMMAXSIZ && vbuf && vsiz <= MEMMAXSIZ); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1205,7 +1205,7 @@ class IndexDB { */ bool append(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz) { _assert_(kbuf && ksiz <= MEMMAXSIZ && vbuf && vsiz <= MEMMAXSIZ); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1237,7 +1237,7 @@ class IndexDB { */ bool remove(const char* kbuf, size_t ksiz) { _assert_(kbuf && ksiz <= MEMMAXSIZ); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1274,7 +1274,7 @@ class IndexDB { */ char* get(const char* kbuf, size_t ksiz, size_t* sp) { _assert_(kbuf && ksiz <= MEMMAXSIZ && sp); - ScopedRWLock lock(&mlock_, false); + // ScopedRWLock lock(&mlock_, false); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); *sp = 0; @@ -1382,7 +1382,7 @@ class IndexDB { */ bool synchronize(bool hard = false, BasicDB::FileProcessor* proc = NULL) { _assert_(true); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1403,7 +1403,7 @@ class IndexDB { */ bool clear() { _assert_(true); - ScopedRWLock lock(&mlock_, true); + // ScopedRWLock lock(&mlock_, true); if (omode_ == 0) { set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); return false; @@ -1422,7 +1422,7 @@ class IndexDB { */ int64_t count() { _assert_(true); - ScopedRWLock lock(&mlock_, false); + // ScopedRWLock lock(&mlock_, false); return count_impl(); } /** @@ -1431,7 +1431,7 @@ class IndexDB { */ int64_t size() { _assert_(true); - ScopedRWLock lock(&mlock_, false); + // ScopedRWLock lock(&mlock_, false); return size_impl(); } /** @@ -1658,8 +1658,6 @@ class IndexDB { IndexDB(const IndexDB&); /** Dummy Operator to forbid the use. */ IndexDB& operator =(const IndexDB&); - /** The method lock. */ - RWLock mlock_; /** The internal database. */ PolyDB db_; /** The open mode. */ |