Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Objects in heaps can be reached in more than one way. We don't want to traverse any object twice, because we will loop, so we must use the GC marked bit.

Yet! There is a way to report all the paths by which an grepped-out object is reachable.

Say we encounter an interesting object O for the first time, at path A B C. So we have A.B.C.O.

We keep objects A, B and C in a hash table. The hash table represents nodes we have visited, which are on the path to a hit.

Then say we encounter object B again, at path X Y Z B. B is a hit in our hash table, and so we report X.Y.Z.B.C.O as another hit for object O, without descending into B again.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: