1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071(*
* Copyright (c) 2018-2022 Tarides <contact@tarides.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)includeIrmin_pack.InodeincludeInode_intfmoduleMake_persistent(H:Irmin.Hash.S)(Node:Irmin.Node.Generic_key.Swithtypehash=H.tandtypecontents_key=H.tPack_key.tandtypenode_key=H.tPack_key.t)(Inter:Internalwithtypehash=H.tandtypekey=H.tPack_key.tandtypeSnapshot.metadata=Node.metadataandtypeVal.step=Node.step)(Pack:Pack_store.Swithtypehash=H.tandtypekey=H.tPack_key.tandtypevalue=Inter.Raw.t)=structmoduleRaw=Inter.RawmodulePack=Packtypefile_manager=Pack.file_managertypedict=Pack.dicttypedispatcher=Pack.dispatcherletto_snapshot=Inter.to_snapshotmoduleXKey=Pack_key.Make(H)includeMake(H)(XKey)(Node)(Inter)(Pack)moduleSnapshot=Inter.Snapshotletof_snapshott~indexv=letfind~expected_depth:_k=letv=Pack.unsafe_find~check_integrity:truetkinvinInter.Val.of_snapshot~indexvfindletv=Pack.vletintegrity_check=Pack.integrity_checkletpurge_lru=Pack.purge_lruletkey_of_offset=Pack.key_of_offsetletunsafe_find_no_prefetchtkey=matchPack.unsafe_find_no_prefetchtkeywith|None->None|Somev->letfind~expected_depth:_k=(* TODO: Remove this dead code. Can the GC traverse `Raw` values? *)Pack.unsafe_find~check_integrity:falsetkinletv=Inter.Val.of_rawfindvinSomevend