From 5d00499cabd7c0ddf5eb9e78c883615cb918197e Mon Sep 17 00:00:00 2001 From: Ziv Scully Date: Sun, 27 Sep 2015 17:24:57 -0400 Subject: Fix effectfulness registration toy cache. --- src/sqlcache.sml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sqlcache.sml') diff --git a/src/sqlcache.sml b/src/sqlcache.sml index e2cc01d7..1518e994 100644 --- a/src/sqlcache.sml +++ b/src/sqlcache.sml @@ -41,6 +41,8 @@ val ffiEffectful = "urlifyBool_w", "urlifyChannel_w"] in + (* ASK: nicer way than using [Settings.addEffectful] for each Sqlcache + function? Right now they're all always effectful. *) fn (m, f) => Settings.isEffectful (m, f) andalso not (m = "Basis" andalso SS.member (okayWrites, f)) end @@ -807,12 +809,15 @@ val expOfSubexp = fn Pure f => f () | Impure e => e +(* TODO: pick a number. *) +val sizeWorthCaching = 5 + fun makeCache (env, exp', index) = case typOfExp' env exp' of NONE => NONE | SOME (TFun _, _) => NONE | SOME typ => - if expSize (exp', dummyLoc) < 5 (* TODO: pick a number. *) + if expSize (exp', dummyLoc) < sizeWorthCaching then NONE else case List.foldr (fn ((_, _), NONE) => NONE | ((n, typ), SOME args) => -- cgit v1.2.3