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.1.tbz
sha256=c3151b243150c7b7412bf27b08107bed0e132f0a271d5f5b34bc0fdffed8ec3e
sha512=4a70d77ed42519a547f7b13e76ccfa05192514ca84e9dc9dcb97a5d141a8cc4551a669017a48290d70f01790a83fbeba53950a2d5f975e8e51e7daf3017d6b5e
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)"
>