v
v copied to clipboard
V initialises unused modules
V version: V 0.2.2 82650ee
What did you do?
module main
import net.http
fn main() {
println('hi')
}
[ ... ]
v -autofree test.v
valgrind ./test
What did you expect to see? No memory leaks
What did you see instead?
==3818== HEAP SUMMARY:
==3818== in use at exit: 199 bytes in 7 blocks
==3818== total heap usage: 4,608 allocs, 4,601 frees, 174,297 bytes allocated
The generated C code contains initialisation blocks for net.openssl
, os
, net.urllib
etc. As well as initialising modules that the compiler recognises as unused, autofree
fails to free these allocations.