diff src/cjr_print.sml @ 1307:d2ad997ca157

Interface for setting memory limits
author Adam Chlipala <adam@chlipala.net>
date Thu, 14 Oct 2010 11:06:26 -0400
parents e665527fce1c
children add5ae41969e
line wrap: on
line diff
--- a/src/cjr_print.sml	Sun Oct 10 20:33:10 2010 -0400
+++ b/src/cjr_print.sml	Thu Oct 14 11:06:26 2010 -0400
@@ -2828,6 +2828,26 @@
              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 @@
                                                   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,