Module Tjr_lru_cache__Im_intf.Lru_entry
type 'v lru_entry
=
|
Insert of
{
value : 'v;
dirty : bool;
}
|
Delete of
{
dirty : bool;
}
|
Lower of 'v option
Cache map entries; values in the map are tagged with a last-accessed time (via underlying Lru impl) and a dirty flag
Entries in the cache for key k:
- (Insert v (dirty=true/false)), this occurs on insert
- (Delete (dirty=true/false))
- (Lower vopt), this occurs when we check the lower layer for a non-existing entry in cache; if we find a value, we insert Lower (Some v), else Lower None; in either case, there is no need to do anything further (ie the entry is not dirty)
- (No entry), for a key that hasn't been seen before