Hello, I'm reading the GC code recently, but I didn't find any code about 
analyzing whether an object is reachable or not (or say whether a pointer 
is live), can someone give me some hints?

I see that each heap word corresponds to a heapBits. By doing & operation 
with bitscan and bitPointer we can judge whether it has more pointers and 
whether it is a pointer, but do we need to judge whether a pointer is live? 
For example, we apply for a piece of memory in a function, do some 
calculations through a pointer, and then return from the function, assuming 
that this piece of memory is useless. In the next GC, how to determine that 
the pointer in this function is dead and we can reclaim this memory?

Thanks~


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7b3facdf-3282-4d88-85a0-342eb5a9fd24n%40googlegroups.com.

Reply via email to