Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
df56cfb2
Commit
df56cfb2
authored
1 year ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] State_builder: adds [reset] function to counters.
parent
bbb0b855
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libraries/project/state_builder.ml
+3
-0
3 additions, 0 deletions
src/libraries/project/state_builder.ml
src/libraries/project/state_builder.mli
+4
-0
4 additions, 0 deletions
src/libraries/project/state_builder.mli
with
7 additions
and
0 deletions
src/libraries/project/state_builder.ml
+
3
−
0
View file @
df56cfb2
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/libraries/project/state_builder.mli
+
4
−
0
View file @
df56cfb2
...
@@ -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 *)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment