I noticed that LMDB already exposes the environment associated with a transaction with the mdb_txn_env function.
https://github.com/LMDB/lmdb/blob/40d3741b7d40ba4c75cb91dd9987ce692d376d71/libraries/liblmdb/lmdb.h#L1019-L1023
We should no longer store a Cow<Arc<EnvInner>> there; instead, use the above function to get the env.
|
struct RoTxnInner<'e> { |
|
/// Makes the struct covariant and !Sync |
|
pub(crate) txn: Option<NonNull<ffi::MDB_txn>>, |
|
env: Cow<'e, Arc<EnvInner>>, |
|
} |
We can simply change the RoTxn::env_mut_ptr method to use the above function.
|
pub(crate) fn env_mut_ptr(&self) -> NonNull<ffi::MDB_env> { |
|
self.inner.env.env_mut_ptr() |
|
} |
I noticed that LMDB already exposes the environment associated with a transaction with the
mdb_txn_envfunction.https://github.com/LMDB/lmdb/blob/40d3741b7d40ba4c75cb91dd9987ce692d376d71/libraries/liblmdb/lmdb.h#L1019-L1023
We should no longer store a
Cow<Arc<EnvInner>>there; instead, use the above function to get the env.heed/heed/src/txn.rs
Lines 56 to 60 in 345db35
We can simply change the
RoTxn::env_mut_ptrmethod to use the above function.heed/heed/src/txn.rs
Lines 103 to 105 in 345db35