comparison src/cache.sml @ 2286:0bdfec16a01d

Fix issue with one-element caches. Locking still WIP.
author Ziv Scully <ziv@mit.edu>
date Fri, 13 Nov 2015 01:04:32 -0500
parents af1585e7d645
children
comparison
equal deleted inserted replaced
2285:ad3ce1528f71 2286:0bdfec16a01d
1 structure Cache = struct 1 structure Cache = struct
2 2
3 type cache = 3 type cache =
4 {(* Takes a query ID and parameters (and, for store, the value to 4 {(* Takes a query ID and parameters (and, for store, the value to
5 store) and gives an FFI call that checks, stores, or flushes the 5 store) and gives an FFI call that checks, stores, or flushes the
6 relevant entry. The parameters are strings for check and store and 6 relevant entry. The parameters are strings for check and store and
7 optional strings for flush because some parameters might not be 7 optional strings for flush because some parameters might not be
8 fixed. *) 8 fixed. *)
9 check : int * Mono.exp list -> Mono.exp', 9 check : int * Mono.exp list -> Mono.exp',
10 store : int * Mono.exp list * Mono.exp -> Mono.exp', 10 store : int * Mono.exp list * Mono.exp -> Mono.exp',
11 flush : int * Mono.exp list -> Mono.exp', 11 flush : int * Mono.exp list -> Mono.exp',
12 lock : int * bool (* true = write, false = read *) -> Mono.exp',
12 (* Generates C needed for FFI calls in check, store, and flush. *) 13 (* Generates C needed for FFI calls in check, store, and flush. *)
13 setupGlobal : Print.PD.pp_desc, 14 setupGlobal : Print.PD.pp_desc,
14 setupQuery : {index : int, params : int} -> Print.PD.pp_desc} 15 setupQuery : {index : int, params : int} -> Print.PD.pp_desc}
15 16
16 end 17 end