V does have neither a manual memory release, nor a garbage collector (reference counting) nor an owner-based mechanism like Rust. How does it decide when to free memory?
You can manually manage memory in V if you like by calling C.malloc
and C.free
.
V has experimental support for automatically freeing memory when it is no longer referenced. Use v -autofree
, but there may be bugs for now. It allows some borrowing of owned memory when the reference doesn't escape. When it does escape, V will reference count the allocation.
It is influenced by Lobster: https://aardappel.github.io/lobster/memory_management.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With