From b2a9404cbfa4e38391d345e137f6dbda963d960d Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 29 Aug 2026 01:14:18 +0000 Subject: Handle equality --- lib/protocols/Handle.ml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/protocols/Handle.ml') diff --git a/lib/protocols/Handle.ml b/lib/protocols/Handle.ml index 9fd1f29..23af476 100644 --- a/lib/protocols/Handle.ml +++ b/lib/protocols/Handle.ml @@ -3,6 +3,7 @@ type protocol = .. class type obj = object method reference : bool method release : unit + method hash : Concepts.Hash.hash method protocols : protocol list end @@ -35,6 +36,9 @@ let copy handle = else None +let equal h1 h2 = + Concepts.Hash.hash_equals (object_of h1)#hash (object_of h2)#hash + let release ({ valid; _ } as handle) = let o = object_of handle in valid := false; -- cgit v1.2.3