Ruby's Mark mechanism

Hello

After doing one mark cycle how GC determines which slots are reachable?.
Does they maintain any database for that?

Thanks

Tridib

On Sep 5, 2012, at 2:41 PM, Tridib B. [email protected]
wrote:

After doing one mark cycle how GC determines which slots are reachable?.
Does they maintain any database for that?

The GC walks the pointers between objects to determine reachability. It
starts from Object (including constants, methods, etc.), the C stack and
the global variables.

Eric H. wrote in post #1074857:

On Sep 5, 2012, at 2:41 PM, Tridib B. [email protected]
wrote:

After doing one mark cycle how GC determines which slots are reachable?.
Does they maintain any database for that?

The GC walks the pointers between objects to determine reachability. It
starts from Object (including constants, methods, etc.), the C stack and
the global variables.

Yes I have a literature stating exactly what you said. But can anyone
tell me in code level where and in which file I can see GC checks for
these objects?

Thanks

Tridib

Tridib B. писал 06.09.2012 19:36:

starts from Object (including constants, methods, etc.), the C stack
and
the global variables.

Yes I have a literature stating exactly what you said. But can anyone
tell me in code level where and in which file I can see GC checks for
these objects?

http://rxr.whitequark.org/mri/source/gc.c#2386 and so on.

On Sep 6, 2012, at 9:59 AM, Peter Z. [email protected]
wrote:

Yes I have a literature stating exactly what you said. But can anyone
tell me in code level where and in which file I can see GC checks for
these objects?

http://rxr.whitequark.org/mri/source/gc.c#2386 and so on.

gc_marks() is probably a better starting point since it lists all the
roots.