summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-08-15 11:26:10 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-08-15 11:26:10 -0400
commite472f946fc2316959e8480e2371233fd275b1da2 (patch)
tree58c04394c5e6d8876f349beceb1ef03ea01ab18a /src/compiler.sml
parentda80f2aa1cd6326d0fc8621a5cfb0e7fd313e192 (diff)
Compiler frees as much memory as possible before passing control to C compiler
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 21ffae27..de6b14b4 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1311,6 +1311,8 @@ val toSqlify = transform sqlify "sqlify" o toMono_opt2
val escapeFilename = String.translate (fn #" " => "\\ " | #"\"" => "\\\"" | #"'" => "\\'" | ch => str ch)
+val beforeC = ref (fn () => ())
+
fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
let
val proto = Settings.currentProtocol ()
@@ -1348,6 +1350,7 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
();
OS.Process.isSuccess (OS.Process.system s))
in
+ !beforeC ();
system compile andalso system link
end