Mercurial > urweb
comparison src/compiler.sml @ 1540:659a2f71f5e5
Compiler frees as much memory as possible before passing control to C compiler
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Mon, 15 Aug 2011 11:26:10 -0400 |
parents | 7770ef82c463 |
children | 6fe6bda2b928 |
comparison
equal
deleted
inserted
replaced
1539:dde3bd82cb3d | 1540:659a2f71f5e5 |
---|---|
1309 | 1309 |
1310 val toSqlify = transform sqlify "sqlify" o toMono_opt2 | 1310 val toSqlify = transform sqlify "sqlify" o toMono_opt2 |
1311 | 1311 |
1312 val escapeFilename = String.translate (fn #" " => "\\ " | #"\"" => "\\\"" | #"'" => "\\'" | ch => str ch) | 1312 val escapeFilename = String.translate (fn #" " => "\\ " | #"\"" => "\\\"" | #"'" => "\\'" | ch => str ch) |
1313 | 1313 |
1314 val beforeC = ref (fn () => ()) | |
1315 | |
1314 fun compileC {cname, oname, ename, libs, profile, debug, link = link'} = | 1316 fun compileC {cname, oname, ename, libs, profile, debug, link = link'} = |
1315 let | 1317 let |
1316 val proto = Settings.currentProtocol () | 1318 val proto = Settings.currentProtocol () |
1317 | 1319 |
1318 val lib = if Settings.getStaticLinking () then | 1320 val lib = if Settings.getStaticLinking () then |
1346 print (s ^ "\n") | 1348 print (s ^ "\n") |
1347 else | 1349 else |
1348 (); | 1350 (); |
1349 OS.Process.isSuccess (OS.Process.system s)) | 1351 OS.Process.isSuccess (OS.Process.system s)) |
1350 in | 1352 in |
1353 !beforeC (); | |
1351 system compile andalso system link | 1354 system compile andalso system link |
1352 end | 1355 end |
1353 | 1356 |
1354 fun compile job = | 1357 fun compile job = |
1355 case run toChecknest job of | 1358 case run toChecknest job of |