Skip to content
Snippets Groups Projects
Commit df56cfb2 authored by David Bühler's avatar David Bühler
Browse files

[Kernel] State_builder: adds [reset] function to counters.

parent bbb0b855
No related branches found
No related tags found
No related merge requests found
...@@ -814,6 +814,7 @@ module Hashconsing_tbl = ...@@ -814,6 +814,7 @@ module Hashconsing_tbl =
module type Counter = sig module type Counter = sig
val next : unit -> int val next : unit -> int
val get: unit -> int val get: unit -> int
val reset: unit -> unit
val self: State.t val self: State.t
end end
...@@ -849,6 +850,7 @@ module SharedCounter(Info : sig val name : string end) = struct ...@@ -849,6 +850,7 @@ module SharedCounter(Info : sig val name : string end) = struct
let next () = incr cpt ; !cpt let next () = incr cpt ; !cpt
let get () = !cpt let get () = !cpt
let reset () = cpt := 0
let self = Cpt.self let self = Cpt.self
end end
...@@ -886,6 +888,7 @@ module Counter(Info : sig val name : string end) = struct ...@@ -886,6 +888,7 @@ module Counter(Info : sig val name : string end) = struct
let next () = incr !cpt ; !(!cpt) let next () = incr !cpt ; !(!cpt)
let get () = !(!cpt) let get () = !(!cpt)
let reset () = !cpt := 0
let self = Cpt.self let self = Cpt.self
end end
......
...@@ -507,6 +507,10 @@ module type Counter = sig ...@@ -507,6 +507,10 @@ module type Counter = sig
(** @return the current value of the counter, without incrementing it. (** @return the current value of the counter, without incrementing it.
@since Fluorine-20130401 *) @since Fluorine-20130401 *)
(** Resets the counter to 0.
@since Frama-C+dev *)
val reset: unit -> unit
val self: State.t val self: State.t
(** @since Oxygen-20120901 *) (** @since Oxygen-20120901 *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment