mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser,fmt: implement [manualfree] module abc
for opting out *all* fns in a given .v from autofree
This commit is contained in:
18
vlib/v/fmt/tests/manualfree_keep.v
Normal file
18
vlib/v/fmt/tests/manualfree_keep.v
Normal file
@ -0,0 +1,18 @@
|
||||
[manualfree]
|
||||
module main
|
||||
|
||||
fn abc() {
|
||||
x := 'abc should be autofreed'
|
||||
println(x)
|
||||
}
|
||||
|
||||
[manualfree]
|
||||
fn xyz() {
|
||||
x := 'xyz should do its own memory management'
|
||||
println(x)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
abc()
|
||||
xyz()
|
||||
}
|
Reference in New Issue
Block a user