comparison src/toy_cache.sml @ 2262:34ad83d9b729

Fix recording bugs to do with nesting and buffer reallocation. Stop MonoFooify printing spurious errors.
author Ziv Scully <ziv@mit.edu>
date Wed, 07 Oct 2015 08:58:08 -0400
parents 6951a645ccdf
children a647a1560628
comparison
equal deleted inserted replaced
2261:f81f1930c5d6 2262:34ad83d9b729
93 string i, 93 string i,
94 string "(uw_context ctx", 94 string "(uw_context ctx",
95 string args, 95 string args,
96 string ") {", 96 string ") {",
97 newline, 97 newline,
98 string "if (cacheQuery", 98 string "if (cacheWrite",
99 string i, 99 string i,
100 (* ASK: is returning the pointer okay? Should we duplicate? *) 100 (* ASK: is returning the pointer okay? Should we duplicate? *)
101 string " == NULL", 101 string " == NULL",
102 string eqs, 102 string eqs,
103 string ") {", 103 string ") {",
114 newline, 114 newline,
115 string "puts(\"SQLCACHE: hit ", 115 string "puts(\"SQLCACHE: hit ",
116 string i, 116 string i,
117 string ".\");", 117 string ".\");",
118 newline, 118 newline,
119 string "uw_write(ctx, cacheWrite", 119 string " if (cacheWrite",
120 string i, 120 string i,
121 string ");", 121 string " != NULL) { uw_write(ctx, cacheWrite",
122 string i,
123 string "); }",
122 newline, 124 newline,
123 string "return cacheQuery", 125 string "return cacheQuery",
124 string i, 126 string i,
125 string ";", 127 string ";",
126 newline, 128 newline,
174 newline, 176 newline,
175 string "cacheQuery", 177 string "cacheQuery",
176 string i, 178 string i,
177 string " = NULL;", 179 string " = NULL;",
178 newline, 180 newline,
181 string "free(cacheWrite",
182 string i,
183 string ");",
184 newline,
185 string "cacheWrite",
186 string i,
187 string " = NULL;",
188 newline,
179 string "puts(\"SQLCACHE: flush ", 189 string "puts(\"SQLCACHE: flush ",
180 string i, 190 string i,
181 string ".\");}", 191 string ".\");}",
182 newline, 192 newline,
183 string "else { puts(\"SQLCACHE: keep ", 193 string "else { puts(\"SQLCACHE: keep ",