I’ve been trying to look at how dynamic languages do memory management
- mostly Ruby and Python - because I’ve been trying to implement a GC
of my own.
The main problem that I’m interested in is how the GC deals with
segmentation. Python’s GC doesn’t do this, so that could solve it.
I’ve tried looking at Ruby’s source code, but I’ve found that its hard
to read and that I don’t understand what it’s GC is doing.
So, my question is, does Ruby’s GC (which is a mark-and-sweep
collector, I believe) deal with segmentation, and if it does, how?
Also, how does it deal with internal pointers to objects on the heap
if those objects are moved? (I mean, if theres a pointer to an object
in the heap, and the object is moved, how does Ruby locate it again?
Or does it avoid this situation by using some sort of lookup
Perhaps these questions are a bit too low-level detailed, I’m not
Anyway, I’d be grateful if someone could clarify those things for me.
Thanks in advance!
– Pie Squared