summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-23 12:25:34 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-23 12:25:34 -0500
commitb826741b92f800aed8b1b4ffe887291897744b69 (patch)
tree4316dc52416e5099c11db0f6214699bdb950019e /src
parent8c4797157d006faa44cdfe702dfbff2ffa7125b9 (diff)
Stop skipping Especialization of generated functions; fix Compiler.parseUrp; expose uw_really_write(); allow more NULL arguments to uw_register_transactional()
Diffstat (limited to 'src')
-rw-r--r--src/c/urweb.c12
-rw-r--r--src/compiler.sml4
-rw-r--r--src/especialize.sml9
3 files changed, 14 insertions, 11 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index f852ddb8..ef159333 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -2773,11 +2773,13 @@ void uw_commit(uw_context ctx) {
for (i = 0; i < ctx->used_transactionals; ++i)
if (ctx->transactionals[i].rollback != NULL)
- ctx->transactionals[i].commit(ctx->transactionals[i].data);
+ if (ctx->transactionals[i].commit)
+ ctx->transactionals[i].commit(ctx->transactionals[i].data);
for (i = 0; i < ctx->used_transactionals; ++i)
if (ctx->transactionals[i].rollback == NULL)
- ctx->transactionals[i].commit(ctx->transactionals[i].data);
+ if (ctx->transactionals[i].commit)
+ ctx->transactionals[i].commit(ctx->transactionals[i].data);
if (uw_db_commit(ctx))
uw_error(ctx, FATAL, "Error running SQL COMMIT");
@@ -2795,7 +2797,8 @@ void uw_commit(uw_context ctx) {
release_client(ctx->client);
for (i = 0; i < ctx->used_transactionals; ++i)
- ctx->transactionals[i].free(ctx->transactionals[i].data);
+ if (ctx->transactionals[i].free)
+ ctx->transactionals[i].free(ctx->transactionals[i].data);
// Splice script data into appropriate part of page
if (ctx->returning_indirectly || ctx->script_header[0] == 0) {
@@ -2855,9 +2858,6 @@ int uw_rollback(uw_context ctx) {
void uw_register_transactional(uw_context ctx, void *data, uw_callback commit, uw_callback rollback,
uw_callback free) {
- if (commit == NULL)
- uw_error(ctx, FATAL, "uw_register_transactional: NULL commit callback");
-
if (ctx->used_transactionals >= ctx->n_transactionals) {
ctx->transactionals = realloc(ctx->transactionals, ctx->used_transactionals+1);
++ctx->n_transactionals;
diff --git a/src/compiler.sml b/src/compiler.sml
index 95ad80ad..88046256 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -596,12 +596,12 @@ fun parseUrp' accLibs fname =
fun p_job' {Job = j, Libs = _ : string list} = p_job j
val parseUrp = {
- func = #Job o parseUrp' false,
+ func = #Job o parseUrp' true,
print = p_job
}
val parseUrp' = {
- func = parseUrp' true,
+ func = parseUrp' false,
print = p_job'
}
diff --git a/src/especialize.sml b/src/especialize.sml
index dfe36ad0..acabe973 100644
--- a/src/especialize.sml
+++ b/src/especialize.sml
@@ -324,10 +324,13 @@ fun specialize' (funcs, specialized) file =
| _ => false) fxs'
orelse (IS.numItems fvs >= length fxs
andalso IS.exists (fn n => functionInside (#2 (List.nth (env, n)))) fvs) then
- default ()
+ ((*Print.prefaces "No" [("name", Print.PD.string name),
+ ("fxs'",
+ Print.p_list (CorePrint.p_exp CoreEnv.empty) fxs')];*)
+ default ())
else
case (KM.find (args, fxs'),
- SS.member (!mayNotSpec, name) orelse IS.member (#specialized st, f)) of
+ SS.member (!mayNotSpec, name) (*orelse IS.member (#specialized st, f)*)) of
(SOME f', _) =>
let
val e = (ENamed f', loc)
@@ -340,7 +343,7 @@ fun specialize' (funcs, specialized) file =
[("e'", CorePrint.p_exp CoreEnv.empty e)];*)
(e, st)
end
- | (_, true) => ((*Print.prefaces ("No(" ^ name ^ ")")
+ | (_, true) => ((*Print.prefaces ("No!(" ^ name ^ ")")
[("fxs'",
Print.p_list (CorePrint.p_exp CoreEnv.empty) fxs')];*)
default ())