From 982260dc0e6cbe29c9dbbb8d49928e5eee67f6f4 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Tue, 7 Jan 2025 14:14:11 +0100 Subject: [PATCH] Fix how we align our map to pagesize and sub our bigarray --- lib/cachet.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cachet.ml b/lib/cachet.ml index f6d941b..fc18414 100644 --- a/lib/cachet.ml +++ b/lib/cachet.ml @@ -490,7 +490,7 @@ let map ({ fd; map; _ } as t) ~pos:logical_address logical_len = (len + (1 lsl t.pagesize)) land lnot ((1 lsl t.pagesize) - 1) else len in - let off = logical_address land ((t.pagesize lsl 1) - 1) in + let off = logical_address land ((1 lsl t.pagesize) - 1) in if len <= 1 lsl t.pagesize then begin let hash = hash 0l (page lsl t.pagesize) land ((1 lsl t.cachesize) - 1) in match t.arr.(hash) with -- 2.47.1