summaryrefslogtreecommitdiff
path: root/src/cache.sml
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2015-12-23 16:01:51 -0500
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2015-12-23 16:01:51 -0500
commit3d3886672433f0775f772d8d2ee47c5f5e0bc745 (patch)
tree072d171c17d92a6696024256c4b2f5aaa760df35 /src/cache.sml
parentbf037ce78c2c76a34ecca0fb8bafa5d5be38968a (diff)
parent4be7962adf740a35222bfd99608c04329a802a04 (diff)
Merge branch 'upstream' into dfsg_clean20151220+dfsg
Diffstat (limited to 'src/cache.sml')
-rw-r--r--src/cache.sml17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cache.sml b/src/cache.sml
new file mode 100644
index 00000000..015c3ff1
--- /dev/null
+++ b/src/cache.sml
@@ -0,0 +1,17 @@
+structure Cache = struct
+
+type cache =
+ {(* Takes a query ID and parameters (and, for store, the value to
+ store) and gives an FFI call that checks, stores, or flushes the
+ relevant entry. The parameters are strings for check and store and
+ optional strings for flush because some parameters might not be
+ fixed. *)
+ check : int * Mono.exp list -> Mono.exp',
+ store : int * Mono.exp list * Mono.exp -> Mono.exp',
+ flush : int * Mono.exp list -> Mono.exp',
+ lock : int * bool (* true = write, false = read *) -> Mono.exp',
+ (* Generates C needed for FFI calls in check, store, and flush. *)
+ setupGlobal : Print.PD.pp_desc,
+ setupQuery : {index : int, params : int} -> Print.PD.pp_desc}
+
+end