mdbx: avoid extra looping inside mdbx_env_info_ex().

This commit is contained in:
Leonid Yuriev 2021-12-07 01:45:41 +03:00
parent 839da86cac
commit f4057b2c3b

View File

@ -19540,8 +19540,6 @@ __cold static int fetch_envinfo_ex(const MDBX_env *env, const MDBX_txn *txn,
#endif /* MDBX_ENABLE_PGOP_STAT*/
}
arg->mi_self_latter_reader_txnid = arg->mi_latter_reader_txnid = 0;
if (lck) {
arg->mi_self_latter_reader_txnid = arg->mi_latter_reader_txnid =
arg->mi_recent_txnid;
for (unsigned i = 0; i < arg->mi_numreaders; ++i) {
@ -19555,7 +19553,6 @@ __cold static int fetch_envinfo_ex(const MDBX_env *env, const MDBX_txn *txn,
arg->mi_self_latter_reader_txnid = txnid;
}
}
}
mdbx_compiler_barrier();
return MDBX_SUCCESS;
@ -19596,6 +19593,9 @@ __cold int mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn,
rc = fetch_envinfo_ex(env, txn, arg, bytes);
if (unlikely(rc != MDBX_SUCCESS))
return rc;
snap.mi_since_sync_seconds16dot16 = arg->mi_since_sync_seconds16dot16;
snap.mi_since_reader_check_seconds16dot16 =
arg->mi_since_reader_check_seconds16dot16;
if (likely(memcmp(&snap, arg, bytes) == 0))
return MDBX_SUCCESS;
memcpy(&snap, arg, bytes);