How would memory management work with the native c...
# kotlin-native
a
How would memory management work with the native compiler? Is there gonna be a way manage memory with native kotlin or is it all done by the compiler like most high level languages? Will there be pointers like in Go and C++ or will it all be inferred by your code structure?
a
It will use reference counting with cycle detection I believe. Which is iOS but with smart reference cycle detection
o
not sure why you use future tense. Memory management is implemented as part of the runtime linked with the compiled code, see https://github.com/JetBrains/kotlin-native/blob/master/runtime/src/main/cpp/Memory.cpp
a
Ah thanks I'm just now looking through the native code after I've spent some time playing with kotlin/JVM, I have a pretty good grasp on kotlin right now, so I'm looking through the native code to make some sense of what is going on (I'll figure things out) and I'm getting a lot of errors right now which should probably go into another thread, specifically with the gradle in the main project. Looks like a ternary is being performed but IntelliJ isn't recognizing it as a ternary? I'm not quite sure tbh.