-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[coq] Adapt
Coq.Protect
interface to incorporate an interruption to…
…ken. - We now conditionally depend on `memprof-limits` on OCaml 4.x - Each call that can be interrupted now additionally takes a `Token.t` There is still more work to be done so this can be properly used. cc: #509
- Loading branch information
Showing
7 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Token = struct | ||
type t = bool ref | ||
let create () = ref false | ||
let set r = r := true | ||
let is_set r = !r | ||
end | ||
|
||
let start () = () | ||
|
||
let limit_with_token ~token:_ f = Result.Ok (f ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(* This is a wrapper for the memprof-limits lib, as it is not | ||
available in most setups *) | ||
module Token : sig | ||
type t | ||
val create : unit -> t | ||
val set : t -> unit | ||
val is_set : t -> bool | ||
end | ||
|
||
val start : unit -> unit | ||
|
||
val limit_with_token : token:Token.t -> (unit -> 'a) -> ('a, exn) Result.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Token = Memprof_limits.Token | ||
|
||
let start = Memprof_limits.start_memprof_limits | ||
|
||
let limit_with_token = Memprof_limits.limit_with_token |