Commits

Yit Phang Khoo committed 9a8d3ad

Pass invalidated timestamp to invalidator in TotalOrder.

Comments (0)

Files changed (2)

Source/Adapton/EagerSATotalOrder.ml

 
     (**/**) (* helper functions *)
     let nop () = ()
-    let invalidator meta () =
+    let invalidator meta ts =
         (* help GC mark phase by cutting the object graph *)
         (* no need to call unmemo since the memo entry will be replaced when it sees start_timestamp is invalid;
             also, no need to replace {start,end}_timestamp with null since they are already cut by TotalOrder during invalidation *)

Source/Adapton/TotalOrder.ml

     val compare : t -> t -> int
     val add_next : t -> t
     val splice : ?inclusive:bool -> t -> t -> unit
-    val set_invalidator : t -> (unit -> unit) -> unit
+    val set_invalidator : t -> (t -> unit) -> unit
     val reset_invalidator : t -> unit
 end = struct
     let threshold = 1.4 (* rebalancing region threshold (inverse density) *)
         mutable parent : parent;
         mutable next : t;
         mutable prev : t;
-        mutable invalidator : unit -> unit;
+        mutable invalidator : t -> unit;
     }
 
     (**/**) (* helper functions *)
-    let nop () = ()
+    let nop _ = ()
     (**/**)
 
     (**/**) (* sentinel values *)
     let pos = (land) (lnot min_int)
     let invalidate ts =
         ts.label <- neg ts.label;
-        ts.invalidator ();
+        ts.invalidator ts;
         (* help GC mark phase by cutting the object graph *)
         ts.invalidator <- nop;
         ts.prev <- null;