aboutsummaryrefslogtreecommitdiffstats
path: root/lib/backend/storage
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-07 23:26:50 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-07 23:26:50 -0300
commit483089803a411920fea7696ea6b40c664cf3003a (patch)
tree7ac682a41db96203fc1bd7d5e1ed6daa76c93c4e /lib/backend/storage
parent4c0c69dc571577e9c3ae68830c042cfaada603ae (diff)
downloadRNT-483089803a411920fea7696ea6b40c664cf3003a.tar.gz
RNT-483089803a411920fea7696ea6b40c664cf3003a.zip
ephemeral literal, relation heading, subs rel stored & lmdb 1GB map
Diffstat (limited to 'lib/backend/storage')
-rw-r--r--lib/backend/storage/LMDB.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/backend/storage/LMDB.ml b/lib/backend/storage/LMDB.ml
index 17dda3f..fd6cc8e 100644
--- a/lib/backend/storage/LMDB.ml
+++ b/lib/backend/storage/LMDB.ml
@@ -43,6 +43,9 @@ module C = struct
let mdb_env_close = foreign "mdb_env_close" (ptr mdb_env @-> returning void)
+ let mdb_env_set_mapsize =
+ foreign "mdb_env_set_mapsize" (ptr mdb_env @-> size_t @-> returning mdb_result)
+
let mdb_dbi_open =
foreign "mdb_dbi_open"
(ptr mdb_txn @-> ptr char @-> uint @-> ptr mdb_dbi @-> returning mdb_result)
@@ -139,6 +142,8 @@ type connection = {env: C.mdb_env_ptr; dbi: C.mdb_dbi}
type transaction = {tx: C.mdb_txn_ptr; dbi: C.mdb_dbi; mutable active: bool}
type address = Label of string | Hash of Concepts.Hash.hash
+let mapsize = 1 lsl 30
+
let parse (c : Concepts.Configuration.term) =
let open Concepts.Configuration in
let open Utilities.Result in
@@ -166,6 +171,7 @@ let connect (c : Concepts.Configuration.term) =
let* () = ensure_directory path (directory_mode mode) in
begin
let* env = C.mdb_env_create' () in
+ let* () = C.mdb_env_set_mapsize env (Unsigned.Size_t.of_int mapsize) in
(* NOTLS ties readers to transactions rather than threads, so one
thread can hold several read transactions (nested cursors). *)
match C.mdb_env_open env path C.Flags.mdb_notls (PosixTypes.Mode.of_int mode) with