HCoop
/
hcoop
/
debian
/
mlton.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Backport from sid to buster
[hcoop/debian/mlton.git]
/
regression
/
finalize.5.sml
1
fun
test
(
str
:
string
) =
2
let open
MLton
.
Finalizable
3
val
x
=
new str
4
exception
Exit
5
in
addFinalizer
(
x
,
fn
s
=>
print
(
s ^
": finalizer
\n
"
));
6
withValue
(
x
,
fn
s
=>
7
(
print
"before GC 6
\n
"
;
8
MLton
.
GC
.
collect
();
9
print
"after GC 6
\n
"
;
10
raise
Exit
))
11
handle
Exit
=> ()
12
end
13
14
val
_
= (
print
"before test 6
\n
"
;
15
test
"test 6"
;
16
print
"before GC 6a
\n
"
;
17
MLton
.
GC
.
collect
();
18
print
"after GC 6a
\n
"
)