aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/toy_cache.sml
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-10-07 08:58:08 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2015-10-07 08:58:08 -0400
commit013ea39e9f187efbb0e3a613264a1c7adfebe692 (patch)
tree601babdc734209052526b2710bfdf628119b5e59 /src/toy_cache.sml
parent36cb6a55281f753774e491cce3178eb8c927983e (diff)
Fix recording bugs to do with nesting and buffer reallocation. Stop MonoFooify printing spurious errors.
Diffstat (limited to 'src/toy_cache.sml')
-rw-r--r--src/toy_cache.sml16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/toy_cache.sml b/src/toy_cache.sml
index 34a7a26f..cfde027b 100644
--- a/src/toy_cache.sml
+++ b/src/toy_cache.sml
@@ -95,7 +95,7 @@ fun setupQuery {index, params} =
string args,
string ") {",
newline,
- string "if (cacheQuery",
+ string "if (cacheWrite",
string i,
(* ASK: is returning the pointer okay? Should we duplicate? *)
string " == NULL",
@@ -116,9 +116,11 @@ fun setupQuery {index, params} =
string i,
string ".\");",
newline,
- string "uw_write(ctx, cacheWrite",
+ string " if (cacheWrite",
string i,
- string ");",
+ string " != NULL) { uw_write(ctx, cacheWrite",
+ string i,
+ string "); }",
newline,
string "return cacheQuery",
string i,
@@ -176,6 +178,14 @@ fun setupQuery {index, params} =
string i,
string " = NULL;",
newline,
+ string "free(cacheWrite",
+ string i,
+ string ");",
+ newline,
+ string "cacheWrite",
+ string i,
+ string " = NULL;",
+ newline,
string "puts(\"SQLCACHE: flush ",
string i,
string ".\");}",