aboutsummaryrefslogtreecommitdiff
path: root/src/db/lmdb_adapter.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-09 14:55:20 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-09 14:55:20 +0200
commit138e13071be37d873344cd03e316c87ff8057ea0 (patch)
treebc74cd3bab1657ca8fec7fda01aba949a9a0897e /src/db/lmdb_adapter.rs
parentb44d3fc796484a50cd6854f20c9b46e5fddedc9d (diff)
downloadgarage-138e13071be37d873344cd03e316c87ff8057ea0.tar.gz
garage-138e13071be37d873344cd03e316c87ff8057ea0.zip
Fix garage_db build on 32-bit systemsfix-build
Diffstat (limited to 'src/db/lmdb_adapter.rs')
-rw-r--r--src/db/lmdb_adapter.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/db/lmdb_adapter.rs b/src/db/lmdb_adapter.rs
index 74622919..62fcc3e6 100644
--- a/src/db/lmdb_adapter.rs
+++ b/src/db/lmdb_adapter.rs
@@ -327,3 +327,17 @@ where
}
}
}
+
+// ----
+
+#[cfg(target_pointer_width = "64")]
+pub fn recommended_map_size() -> usize {
+ 1usize << 40
+}
+
+#[cfg(target_pointer_width = "32")]
+pub fn recommended_map_size() -> usize {
+ use log::warn;
+ warn!("LMDB is not recommended on 32-bit systems, database size will be limited");
+ 1usize << 30
+}