v2 / vlib / v / fmt / tests / manualfree_keep.vv
18 lines · 15 sloc · 201 bytes · dd3e3e110b8374f26c8667be676e6683bfc57c90
Raw
1@[manualfree]
2module main
3
4fn abc() {
5 x := 'abc should be autofreed'
6 println(x)
7}
8
9@[manualfree]
10fn xyz() {
11 x := 'xyz should do its own memory management'
12 println(x)
13}
14
15fn main() {
16 abc()
17 xyz()
18}
19