From 7bf0a0124a6c8a834983a660af53d8789ac0a8ac Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 14 Oct 2010 11:06:26 -0400 Subject: Interface for setting memory limits --- src/cjr_print.sml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/cjr_print.sml') diff --git a/src/cjr_print.sml b/src/cjr_print.sml index ae347eb2..29f94fe6 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2828,6 +2828,26 @@ fun p_file env (ds, ps) = newline, newline, + box [string "static void uw_setup_limits() {", + newline, + box [p_list_sep (box []) (fn (class, num) => + let + val num = case class of + "page" => Int.max (2048, num) + | _ => num + in + box [string ("uw_" ^ class ^ "_max"), + space, + string "=", + space, + string (Int.toString num), + string ";", + newline] + end) (Settings.limits ())], + string "}", + newline, + newline], + #code (Settings.currentProtocol ()) (), if hasDb then @@ -2837,17 +2857,17 @@ fun p_file env (ds, ps) = views = !views, sequences = !sequences} else - box [string "void uw_client_init(void) { };", + box [string "static void uw_client_init(void) { };", newline, - string "void uw_db_init(uw_context ctx) { };", + string "static void uw_db_init(uw_context ctx) { };", newline, - string "int uw_db_begin(uw_context ctx) { return 0; };", + string "static int uw_db_begin(uw_context ctx) { return 0; };", newline, - string "void uw_db_close(uw_context ctx) { };", + string "static void uw_db_close(uw_context ctx) { };", newline, - string "int uw_db_commit(uw_context ctx) { return 0; };", + string "static int uw_db_commit(uw_context ctx) { return 0; };", newline, - string "int uw_db_rollback(uw_context ctx) { return 0; };"], + string "static int uw_db_rollback(uw_context ctx) { return 0; };"], newline, newline, -- cgit v1.2.3