Select the types of activity you want to include in your feed.
Replace Stdlib.Mutex lock/unlock with Eio.Mutex.use_rw
Convert remaining bare Mutex.lock/unlock patterns to Eio.Mutex.use_rw/use_ro in cookeio, requests, oci, and space. Fix unattached doc comment in vds.ml Node_cache.
···9595 end
9696end
97979898-(** Internal node cache. In an append-only tree, compute_root(offset, len) is
9999- immutable once all [len] leaves at [offset] exist. Cache hits make
100100- inclusion_path O(log n) instead of O(n). *)
101101-(** Internal node cache with bounded size.
9898+(* Internal node cache with bounded size.
10299103103- In an append-only tree, subtree hashes are immutable once computed. The
104104- cache maps [(offset, length)] to the subtree root hash. On overflow, only
105105- power-of-2-length entries are kept — these are "complete" subtrees that are
106106- maximally reused and cheapest to lose (they'd be recomputed in O(1) from
107107- two cached children). *)
100100+ In an append-only tree, subtree hashes are immutable once computed. The
101101+ cache maps (offset, length) to the subtree root hash. On overflow, only
102102+ power-of-2-length entries are kept — these are "complete" subtrees that are
103103+ maximally reused and cheapest to lose (they'd be recomputed in O(1) from
104104+ two cached children). *)
108105module Node_cache = struct
109106 let default_max_entries = 100_000
110107···259256 }
260257261258 let with_lock t f = Eio.Mutex.use_rw ~protect:true t.mu f
262262-263259 let algorithm_id t = Hash.id t.hash
264260 let proof_format _ = Hash.Rfc9162
265261 let size t = with_lock t (fun () -> Growable.length t.hashes)
···340336 }
341337342338 let with_lock t f = Eio.Mutex.use_rw ~protect:true t.mu f
343343-344339 let algorithm_id t = Hash.id t.hash
345340 let proof_format _ = Hash.Rfc9162
346341 let size t = with_lock t (fun () -> t.entry_count)