summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src/dbintf.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-11 21:08:46 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-11 21:08:46 +0300
commitdd1fc18d107a2cac81acdd8055403bf8d8ca7413 (patch)
treef29dd3b0576d5adebbc3de00de83657d5fa28f2d /plugins/Dbx_mdbx/src/dbintf.cpp
parentb69809d6331b17865cc657cfd2ad48ed7464a6f2 (diff)
dbx_mdbx:
- Remap() / MDBX_CHECK perversion removed; - mdbx_env_set_geometry() is used to grow file automatically
Diffstat (limited to 'plugins/Dbx_mdbx/src/dbintf.cpp')
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp
index 09d350b6c9..5fa6220a58 100644
--- a/plugins/Dbx_mdbx/src/dbintf.cpp
+++ b/plugins/Dbx_mdbx/src/dbintf.cpp
@@ -183,19 +183,19 @@ STDMETHODIMP_(void) CDbxMDBX::SetCacheSafetyMode(BOOL bIsSet)
int CDbxMDBX::Map()
{
+ int rc = mdbx_env_set_geometry(m_env,
+ -1 /* minimal lower limit */,
+ 64ul << 10 /* atleast 64K for now */,
+ 256ul << 20 /* 256M upper limit */,
+ 256ul << 10 /* 256K growth step */,
+ 512ul << 10 /* 512K shrink threshold */,
+ -1 /* default page size */);
+ if (rc != MDBX_SUCCESS)
+ return rc;
unsigned int mode = MDBX_NOSUBDIR | MDBX_MAPASYNC | MDBX_WRITEMAP | MDBX_NOSYNC;
if (m_bReadOnly)
mode |= MDBX_RDONLY;
- mdbx_env_open(m_env, _T2A(m_tszProfileName), mode, 0664);
- mdbx_env_set_mapsize(m_env, 0x1000000);
- return MDBX_SUCCESS;
-}
-
-bool CDbxMDBX::Remap()
-{
- MDBX_envinfo ei;
- mdbx_env_info(m_env, &ei, sizeof(ei));
- return mdbx_env_set_geometry(m_env, -1, -1, ei.mi_mapsize + 0x100000, 0x100000, -1, -1) == MDBX_SUCCESS;
+ return mdbx_env_open(m_env, _T2A(m_tszProfileName), mode, 0664);
}
/////////////////////////////////////////////////////////////////////////////////////////