Skip to content

Commit 092418b

Browse files
committed
LDMB Disk Cache: add comment on the idx selection in put
1 parent 886ec39 commit 092418b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/disk_cache/lmdb/disk_cache.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ module Make (Data : Binable.S) = struct
4242
let idx =
4343
match Queue.dequeue reusable_keys with
4444
| None ->
45+
(* We don't have reusable keys, assign a new one nobody ever used *)
4546
incr counter ; !counter - 1
4647
| Some reused_key ->
48+
(* Any key inside [reusable_keys] is marked as garbage by GC, so we're
49+
free to use them *)
4750
reused_key
4851
in
4952
let res = { idx } in

0 commit comments

Comments
 (0)