How does cycle collector work?
# kotlin-native
h
How does cycle collector work?
c
From what I understand, it traverses the object graph and visits each reachable object. When all reachable objects have been visited, it frees the object not yet seen. (Correct me if I'm wrong, here's the source code: https://github.com/JetBrains/kotlin-native/blob/master/runtime/src/main/cpp/Memory.cpp#L740)
o
it doesn't traverse whole object graph, it implements algorithm known as trial deletion
c
Interesting, thanks. In case anyone else is wondering how it works, I've found section 5.3 here to contain a good description: https://www.cs.virginia.edu/~cs415/reading/bacon-garbage.pdf
h
nice, thank you!