Module Tjr_lib_core.Lru_two_gen_v3pure

Internal module

Version with delete

type 'v entry = [
| `Inserted of 'v
| `Deleted
| `Lower_some of 'v
| `Lower_none
]

Entries in the internal maps can record that an entry has been deleted, or that an entry is present in the lower map m3;

type 'v entry = [ `Inserted of 'v | `Deleted | `Lower_some of 'v | `Lower_none ] 
type 'v dirty_entry = [
| `Inserted of 'v
| `Deleted
]
module Cache_state : sig ... end

Cache state; internal

type ('k, 'v, 'c) ops = {
find_raw : c:'c -> 'k -> 'v entry option;
insert : c:'c -> 'k -> 'v -> unit;
insert_raw : c:'c -> 'k -> 'v entry -> unit;
delete : c:'c -> 'k -> unit;
needs_trim : c:'c -> bool;
trim : c:'c -> ('k * 'v entry) list;
bindings : c:'c -> ('k * 'v entry) list;
dirties : c:'c -> ('k * 'v dirty_entry) list;
clean : c:'c -> ('k * 'v dirty_entry) list;
debug : c:'c -> ('k'v entry) Tjr_lib_core__.Hashtbl.t * ('k'v entry) Tjr_lib_core__.Hashtbl.t;
}

API; 'c is the cache type

module type S = sig ... end
module type T = sig ... end
module Make : functor (S : S) -> T with module S = S

For some applications, we want very precise control of the cache, ie not to have the cache state hidden inside functions, but instead be referenced explicitly