comparison src/settings.sml @ 1307:d2ad997ca157

Interface for setting memory limits
author Adam Chlipala <adam@chlipala.net>
date Thu, 14 Oct 2010 11:06:26 -0400
parents b4480a56cab7
children 714e8b84221b
comparison
equal deleted inserted replaced
1306:3a845f2ce9e9 1307:d2ad997ca157
488 488
489 val onError = ref (NONE : (string * string list * string) option) 489 val onError = ref (NONE : (string * string list * string) option)
490 fun setOnError x = onError := x 490 fun setOnError x = onError := x
491 fun getOnError () = !onError 491 fun getOnError () = !onError
492 492
493 val limits = ["messages", "clients", "headers", "page", "heap", "script",
494 "inputs", "subinputs", "cleanup", "deltas", "transactionals",
495 "globals", "database"]
496
497 val limitsList = ref ([] : (string * int) list)
498 fun addLimit (v as (name, _)) =
499 if List.exists (fn name' => name' = name) limits then
500 limitsList := v :: !limitsList
501 else
502 raise Fail ("Unknown limit category '" ^ name ^ "'")
503 fun limits () = !limitsList
504
493 end 505 end