aboutsummaryrefslogtreecommitdiff
path: root/plugins/micromega/persistent_cache.ml
diff options
context:
space:
mode:
authorVincent Laporte2018-10-10 08:36:22 +0000
committerVincent Laporte2018-10-16 09:23:09 +0000
commit1018c2c749fba12790d623a5889da91453dddabb (patch)
tree583be8ad87ada42d42efa336053485be4854dfdf /plugins/micromega/persistent_cache.ml
parent28127d3bb4a0e151820e04a3efc4846ababb7d71 (diff)
[micromega] remove dead code
Diffstat (limited to 'plugins/micromega/persistent_cache.ml')
-rw-r--r--plugins/micromega/persistent_cache.ml27
1 files changed, 0 insertions, 27 deletions
diff --git a/plugins/micromega/persistent_cache.ml b/plugins/micromega/persistent_cache.ml
index ee5a0458e8..0209030b64 100644
--- a/plugins/micromega/persistent_cache.ml
+++ b/plugins/micromega/persistent_cache.ml
@@ -19,11 +19,6 @@ module type PHashtable =
type 'a t
type key
- val create : int -> string -> 'a t
- (** [create i f] creates an empty persistent table
- with initial size i associated with file [f] *)
-
-
val open_in : string -> 'a t
(** [open_in f] rebuilds a table from the records stored in file [f].
As marshaling is not type-safe, it migth segault.
@@ -37,11 +32,6 @@ module type PHashtable =
(and writes the binding to the file associated with [tbl].)
If [key] is already bound, raises KeyAlreadyBound *)
- val close : 'a t -> unit
- (** [close tbl] is closing the table.
- Once closed, a table cannot be used.
- i.e, find,add will raise UnboundTable *)
-
val memo : string -> (key -> 'a) -> (key -> 'a)
(** [memo cache f] returns a memo function for [f] using file [cache] as persistent table.
Note that the cache will only be loaded when the function is used for the first time *)
@@ -71,14 +61,6 @@ struct
}
-let create i f =
- let flags = [O_WRONLY; O_TRUNC;O_CREAT] in
- {
- outch = out_channel_of_descr (openfile f flags 0o666);
- status = Open ;
- htbl = Table.create i
- }
-
let finally f rst =
try
let res = f () in
@@ -181,15 +163,6 @@ let open_in f =
end
-let close t =
- let {outch = outch ; status = status ; htbl = tbl} = t in
- match t.status with
- | Closed -> () (* don't do it twice *)
- | Open ->
- close_out outch ;
- Table.clear tbl ;
- t.status <- Closed
-
let add t k e =
let {outch = outch ; status = status ; htbl = tbl} = t in
if status == Closed