From 7cfcaa57a68ea9abde9e2558ceef86589aa26d6d Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Wed, 8 Oct 2014 17:28:18 +0200 Subject: STM: primitives to snapshot a .vi while in interactive mode --- lib/remoteCounter.ml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/remoteCounter.ml') diff --git a/lib/remoteCounter.ml b/lib/remoteCounter.ml index 72887b21ac..c0217b22e5 100644 --- a/lib/remoteCounter.ml +++ b/lib/remoteCounter.ml @@ -37,6 +37,9 @@ let new_counter ~name a ~incr ~build = let backup () = !counters +let snapshot () = + List.map (fun (n,v) -> n, Obj.repr (ref (ref !!(Obj.obj v)))) !counters + let restore l = List.iter (fun (name, data) -> assert(List.mem_assoc name !counters); -- cgit v1.2.3