Skip to content

Commit b0197f2

Browse files
committed
add commentsg
1 parent e9131a8 commit b0197f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/kernel/phase_cache.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ module With_cache (Phase : S) = struct
3636
}
3737

3838
let get_next_version =
39+
(* A mutable counter separate from [cache.version] is necessary because of [Phase.f]
40+
erroring. In [apply], when [Phase.f = Error], cache is reset to [None], losing the
41+
value of [next_version] if not stored elsewhere. *)
3942
let next_version = ref 0 in
4043
fun () : Version.t ->
4144
let v = Some !next_version in
4245
incr next_version;
4346
v
47+
4448
let cache = ref None
4549

4650
let apply ?(cache_disabling = None) ?(force_invalidation = false) input =

0 commit comments

Comments
 (0)