Skip to content

Commit 6eb0384

Browse files
committed
Make it work on env opened with WRITEMAP
1 parent a31d54e commit 6eb0384

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

heed/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "heed"
3-
version = "0.22.1-nested-rtxns-2"
3+
version = "0.22.1-nested-rtxns-3"
44
authors = ["Kerollmops <[email protected]>"]
55
description = "A fully typed LMDB (mdb.master) wrapper with minimum overhead"
66
license = "MIT"
@@ -16,7 +16,7 @@ byteorder = { version = "1.5.0", default-features = false }
1616
heed-traits = { version = "0.20.0", path = "../heed-traits" }
1717
heed-types = { version = "0.21.0", default-features = false, path = "../heed-types" }
1818
libc = "0.2.175"
19-
lmdb-master-sys = { version = "0.2.6-nested-rtxns", path = "../lmdb-master-sys" }
19+
lmdb-master-sys = { version = "0.2.6-nested-rtxns-3", path = "../lmdb-master-sys" }
2020
once_cell = "1.21.3"
2121
page_size = "0.6.0"
2222
serde = { version = "1.0.223", features = ["derive"], optional = true }

heed/examples/nested-rtxns.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
use heed::types::*;
2-
use heed::{Database, EnvOpenOptions};
2+
use heed::{Database, EnvFlags, EnvOpenOptions};
33
use rand::prelude::*;
44
use rayon::prelude::*;
55
use roaring::RoaringBitmap;
66

77
fn main() -> Result<(), Box<dyn std::error::Error>> {
88
let dir = tempfile::tempdir()?;
99
let env = unsafe {
10-
EnvOpenOptions::new()
11-
.read_txn_without_tls()
10+
let mut options = EnvOpenOptions::new().read_txn_without_tls();
11+
#[cfg(not(windows))]
12+
options.flags(EnvFlags::WRITE_MAP);
13+
options
1214
.map_size(2 * 1024 * 1024 * 1024) // 2 GiB
1315
.open(dir.path())?
1416
};

lmdb-master-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lmdb-master-sys"
33
# NB: When modifying, also modify html_root_url in lib.rs
4-
version = "0.2.6-nested-rtxns"
4+
version = "0.2.6-nested-rtxns-3"
55
authors = [
66
"Kerollmops <[email protected]>",
77
"Dan Burkert <[email protected]>",

0 commit comments

Comments
 (0)