aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/kernel/Namespace.ml11
-rw-r--r--lib/kernel/Namespace.mli1
-rw-r--r--lib/kernel/Path.ml8
-rw-r--r--lib/kernel/Session.ml1
4 files changed, 8 insertions, 13 deletions
diff --git a/lib/kernel/Namespace.ml b/lib/kernel/Namespace.ml
index c7cc627..c7c0767 100644
--- a/lib/kernel/Namespace.ml
+++ b/lib/kernel/Namespace.ml
@@ -5,7 +5,6 @@ class namespace =
method to_string = "namespace"
val entries : (string, Protocols.Handle.t) BatMap.t Atomic.t = Atomic.make BatMap.empty
method protocols = Protocols.[Directory.make self; Registry.make self]
-
method destroy = Atomic.get entries |> BatMap.values |> BatEnum.iter Protocols.Handle.release
method update key reference value =
@@ -13,11 +12,11 @@ class namespace =
Utilities.Atomic.mswap entries (fun e ->
let existing = BatMap.find_opt key e in
if existing = reference then begin
- Option.map Protocols.Handle.release existing |> ignore;
- match value with
- | Some v -> Ok (BatMap.add key (Protocols.Handle.move v) e)
- | None -> Ok (BatMap.remove key e)
- end
+ Option.map Protocols.Handle.release existing |> ignore;
+ match value with
+ | Some v -> Ok (BatMap.add key (Protocols.Handle.move v) e)
+ | None -> Ok (BatMap.remove key e)
+ end
else Error () )
with
| Ok _ -> Ok true
diff --git a/lib/kernel/Namespace.mli b/lib/kernel/Namespace.mli
index 9d4f343..394e44a 100644
--- a/lib/kernel/Namespace.mli
+++ b/lib/kernel/Namespace.mli
@@ -2,7 +2,6 @@ class namespace : object
inherit Protocols.Handle.obj
inherit Protocols.Directory.implementation
inherit Protocols.Registry.implementation
-
method destroy : unit
end
diff --git a/lib/kernel/Path.ml b/lib/kernel/Path.ml
index a2e270e..2e712cc 100644
--- a/lib/kernel/Path.ml
+++ b/lib/kernel/Path.ml
@@ -23,8 +23,7 @@ let walking f g handle path =
let open Protocols in
let open Utilities.Result in
let rec walk handle = function
- | [] ->
- g (Handle.keep handle)
+ | [] -> g (Handle.keep handle)
| x :: xs -> (
let* dir =
Handle.require Directory.from handle
@@ -36,11 +35,10 @@ let walking f g handle path =
| None -> Error (Error.path_not_found path)
| Some elem -> f x handle (fun () -> walk elem xs) )
in
- Handle.with_autorelease
- (fun () ->
+ Handle.with_autorelease (fun () ->
walk handle path
|> Result.map_error
- Concepts.Condition.(complement ("path" |=| Concepts.Value.String (to_string path))))
+ Concepts.Condition.(complement ("path" |=| Concepts.Value.String (to_string path))) )
let lookup handle path = walking (fun _ _ f -> f ()) Result.ok handle path
diff --git a/lib/kernel/Session.ml b/lib/kernel/Session.ml
index 0f5f353..231f518 100644
--- a/lib/kernel/Session.ml
+++ b/lib/kernel/Session.ml
@@ -13,7 +13,6 @@ module Make (S : Abstract.Storage.STORAGE) = struct
method pin state' = Atomic.set state state'
method protocols = Protocols.[Directory.make self; Session.make self]
method list = Ok (BatFingerTree.singleton "branch")
-
method destroy = ()
method find =