https://kotlinlang.org logo
Title
n

nimtiazm

05/01/2017, 5:53 PM
i’ve been trying out rust to see how their memory management works without GC and ARC. Admittedly it’s a radical model but it’s good.
👍 1
o

olonho

05/01/2017, 6:40 PM
nimtiazm: could you be a bit more specific, what do you mean by "manual memory handling will work in konan". In a sense, memory scopes is one way of semi-manual memory handling in Kotlin/Native, and explicit memory allocation is the way to do it C way. We also working on compiler-assisted memory allocation optimizations.
n

nimtiazm

05/01/2017, 7:15 PM
I am focusing on memory deallocation, scope and life-time of objects which should be deterministic and doesn’t have huge memory requirements. A while ago it was told that KN will probably have switchable memory management to cover varying needs.
So that’s what I was asking about. Has there been any thoughts on it yet? Like is it going to be a full ownership model (assisted by annotations maybe?) or something lighter like C++11 smart pointers
o

olonho

05/01/2017, 7:23 PM
not exactly, however we are working on escape-analysis driven allocations bound to the frame "owning" an object, adding C++-style pointers or annotations doesn't play well with stdlib