In the 2017 article about Kotlin Native: https://blog.jetbrains.com/kotlin/2017/04/kotlinnative-tech-preview-kotlin-without-a-vm/ manual memory management was mentioned:
Some platforms may only need manual memory management, and get an even smaller Kotlin/Native runtime in return.
Will manual memory management still be supported? If so, when can we look forward to this?
Hello, @willisjtc! I looked through this article and, unfortunately, it seems like a bit obsolete. In its current state, Kotlin/Native uses automatic memory management. One manages memory manually only when working with C libraries, accessible via generated Kotlin bindings, see C Interop.
Can you tell what is your use-case here?
I was reading this article from Discord and was thinking about how nice having manual memory management would be for certain situations: gaming, systems, hyper critical performance apps that require no gc pauses...
https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f
@willisjtc it seems like it's not what Kotlin is aimed at, it's app level language (like Swift) and you are looking for something like Rust/C++
but let's be real, who wouldn't rather use Kotlin than rust/c++?
@charlag in swift, you actually do have the ability to do manual memory management.
Having manual memory management with kotlin native would give it a competitive edge, imho
Will manual memory management still be supported? If so, when can we look forward to this?
Manual memory management for C structures and arrays is available.
We don't plan to support manual memory management for Kotlin objects anytime soon, and don't have ETA for this.
Closing this issue as answered.
Most helpful comment
but let's be real, who wouldn't rather use Kotlin than rust/c++?