mdbx: windows - fix truncation race while unmap.

Change-Id: I93983d100c78aa3e57c5a7ebd9d5bf2a96081ed7
This commit is contained in:
Leo Yuriev
2018-06-15 02:54:41 +03:00
parent b6e605b8da
commit f314cd6b92
2 changed files with 10 additions and 7 deletions

View File

@@ -2041,6 +2041,11 @@ static int mdbx_mapresize(MDBX_env *env, const pgno_t size_pgno,
bailout:
if (rc == MDBX_SUCCESS) {
#if defined(_WIN32) || defined(_WIN64)
assert(size_bytes == env->me_dxb_mmap.current);
assert(size_bytes <= env->me_dxb_mmap.filesize);
assert(limit_bytes == env->me_dxb_mmap.length);
#endif
env->me_dbgeo.now = size_bytes;
env->me_dbgeo.upper = limit_bytes;
if (env->me_txn) {