mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
compiler: -autofree flag
This commit is contained in:
parent
079dcd1fff
commit
3d2c266980
2 changed files with 4 additions and 4 deletions
|
@ -1067,9 +1067,8 @@ fn (p mut Parser) close_scope() {
|
|||
// println('breaking. "$v.name" v.scope_level=$v.scope_level')
|
||||
break
|
||||
}
|
||||
// Clean up memory, only do this for V compiler for now
|
||||
//if p.os != .windows {
|
||||
if p.pref.building_v && v.is_alloc && !p.pref.is_test {
|
||||
// Clean up memory, only do this if -autofree was passed for now
|
||||
if p.pref.autofree && v.is_alloc && !p.pref.is_test {
|
||||
mut free_fn := 'free'
|
||||
if v.typ.starts_with('array_') {
|
||||
free_fn = 'v_array_free'
|
||||
|
@ -1092,7 +1091,6 @@ fn (p mut Parser) close_scope() {
|
|||
} else {
|
||||
p.genln('$free_fn($v.name); // close_scope free')
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
if p.cur_fn.defer_text.last() != '' {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue