that would be interesting in practice with cross platform kotlin modules. simple reference cycles can trip up expert java devs when going to ARC
s
svyatoslav.scherbina
09/01/2017, 11:08 AM
The Objective-C memory management is used only for Objective-C objects (and objects of Kotlin classes that are inherited from Objective-C classes). So the reference cycles consisting of pure Kotlin objects are collected.
And cross platform modules will probably consist of pure Kotlin classes.
a
agrosner
09/01/2017, 12:06 PM
Ok that answers it. Thank you. Just wondered if there was going to be IDE warnings or inspections. That said is a garbage collector or something else?
o
olonho
09/01/2017, 1:33 PM
you mean IDE assistance in finding memory bugs, such as cycles? For pure Kotlin/Native it doesn't look like a big deal, as Svyatoslav mentioned, we have cycle collector, for Objective C interop - this problem exists,but we expect that complicated data structures with cycles will be on the Kotlin side
a
agrosner
09/01/2017, 3:30 PM
how would this work? when it collects them, monitors when one of the objects can be dereferenced? just wondering if the behavior will diverge from ARC or is this smarter ARC