diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-14 15:48:21 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-14 15:48:21 +0000 |
commit | 7f9dacb21b81a04549df028b1493802b7da069fd (patch) | |
tree | df1b0477b1e34cf5b9c84e37a97a1c55699b861b /plugins/Dbx_mdb/src/dbintf.cpp | |
parent | d49312735885a76fac1ff9380a1609883cd6b764 (diff) |
dbx_lmdb: common project, small speed optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16278 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbintf.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbintf.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index b0ab3a2b01..503746369e 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "commonheaders.h"
+#include "stdafx.h"
static int ModCompare(const ModuleName *mn1, const ModuleName *mn2)
{
@@ -187,11 +187,11 @@ bool CDbxMdb::Remap() m_dwFileSize += 0x100000;
mdb_env_set_mapsize(m_pMdbEnv, m_dwFileSize);
- int mode = MDB_NOSYNC | MDB_NOSUBDIR;
+ int mode = MDB_NOSYNC | MDB_NOSUBDIR | MDB_NOLOCK; // nolock - miranda using m_csDbAccess lock
if (m_bReadOnly)
- mode += MDB_RDONLY;
+ mode |= MDB_RDONLY;
else
- mode += MDB_WRITEMAP;
+ mode |= MDB_WRITEMAP;
return mdb_env_open(m_pMdbEnv, _T2A(m_tszProfileName), mode, 0664) == MDB_SUCCESS;
}
@@ -209,7 +209,7 @@ void __cdecl dbpanic(void *) msg = TranslateT("Disk is full. Miranda will now shut down.");
TCHAR err[256];
- mir_sntprintf(err, SIZEOF(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
+ mir_sntprintf(err, _countof(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
|