package mnet
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
An implementation of TCP (Transmission Control Protocol) in OCaml for Miou & Solo5
Install
dune-project
Dependency
Authors
Maintainers
Sources
mnet-0.0.3.tbz
sha256=85ceac44091bae441d88789b3ce9efe9e206e9905edb37fb8de10121d89c870a
sha512=cad757a660625c085f7c1f337ca7b85cf0145d1e8ef9886200be75174f51519e3443fe5757e061d76b14852a7082728448a7a484949c4a0ebd3011f328b7a25f
doc/src/mnet.arpv4/table.ml.html
Source file table.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46module type V = sig type t val is_disposable : t -> bool end module Make (K : Hashtbl.HashedType) (V : V) = struct module W = struct type t = Weight let weight Weight = 1 end module Lru = Lru.M.Make (K) (W) type key = K.t type value = V.t type t = { entries: (key, value) Hashtbl.t; disposables: Lru.t } let create size = { entries= Hashtbl.create size; disposables= Lru.create size } let add t key value = Hashtbl.replace t.entries key value; if V.is_disposable value then Lru.add key Weight t.disposables else Lru.remove key t.disposables; while Lru.weight t.disposables > Lru.capacity t.disposables do match Lru.lru t.disposables with | None -> () | Some (key', Weight) -> Hashtbl.remove t.entries key'; Lru.remove key' t.disposables done let find t key = Lru.promote key t.disposables; Hashtbl.find t.entries key let remove t key = Hashtbl.remove t.entries key; Lru.remove key t.disposables let fold fn t acc = Hashtbl.fold fn t.entries acc let reset t = Hashtbl.reset t.entries let iter fn t = Hashtbl.iter fn t.entries end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>