package riot
An actor-model multi-core scheduler for OCaml 5
Install
dune-project
Dependency
Authors
Maintainers
Sources
riot-0.0.3.tbz
sha256=6201ce27997ec1c4b4509782c6be2fa2bf102b804b11dcbf9ebdb49a123c19c3
sha512=ad70a67601a892700e461efe57484d109b1d08e30d15464ad8611e71dd568c934d3f948afd645e096e4f97ad1935aaeaf5d9b6d9d59c52a82eeb5c4995421646
doc/src/riot.util/dashmap.ml.html
Source file dashmap.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
type ('k, 'v) t = { tbl : ('k * 'v) list Atomic.t } [@@unboxed] let create _size = { tbl = Atomic.make [] } let entries t = Atomic.get t.tbl let find t k = List.assoc_opt k (entries t) let find_by t fn = List.find_opt fn (entries t) let find_all_by t fn = List.find_all fn (entries t) let has_key t k = find t k |> Option.is_some let rec insert t k v = let tbl1 = entries t in let entry = (k, v) in if List.mem entry tbl1 then () else let tbl2 = (k, v) :: tbl1 in if Atomic.compare_and_set t.tbl tbl1 tbl2 then () else insert t k v let rec remove_by t fn = let tbl1 = entries t in let tbl2 = List.filter fn tbl1 in if Atomic.compare_and_set t.tbl tbl1 tbl2 then () else remove_by t fn let rec replace t k v = let tbl1 = entries t in let tbl2 = (k, v) :: List.remove_assoc k tbl1 in if Atomic.compare_and_set t.tbl tbl1 tbl2 then () else replace t k v
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>