Skip to content

Commit 53e8319

Browse files
committed
Fix dump mistake and do not use TLS when we said so
1 parent a4c3bd2 commit 53e8319

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

heed/src/envs/env_open_options.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use super::{canonicalize_path, OPENED_ENV};
2222
use crate::envs::OsStrExtLmdb as _;
2323
use crate::mdb::error::mdb_result;
2424
use crate::mdb::ffi;
25-
use crate::txn::{TlsUsage, WithoutTls};
26-
use crate::{EnvFlags, Error, Result, WithTls};
25+
use crate::txn::{TlsUsage, WithTls, WithoutTls};
26+
use crate::{EnvFlags, Error, Result};
2727

2828
/// Options and flags which can be used to configure how an environment is opened.
2929
#[derive(Debug, PartialEq, Eq)]
@@ -130,6 +130,7 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
130130
let Self { map_size, max_readers, max_dbs, flags, _tls_marker: _ } = self;
131131
EnvOpenOptions { map_size, max_readers, max_dbs, flags, _tls_marker: PhantomData }
132132
}
133+
133134
/// Set the size of the memory map to use for this environment.
134135
///
135136
/// It must be a multiple of the OS page size.
@@ -462,9 +463,9 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
462463
#[allow(deprecated)] // NO_TLS is inside of the crate
463464
let flags = if T::ENABLED {
464465
// TODO make this a ZST flag on the Env and on RoTxn (make them Send when we can)
465-
self.flags | EnvFlags::NO_TLS
466-
} else {
467466
self.flags
467+
} else {
468+
self.flags | EnvFlags::NO_TLS
468469
};
469470

470471
let result = ffi::mdb_env_open(env, path_str.as_ptr(), flags.bits(), 0o600);

0 commit comments

Comments
 (0)