Hacker News new | past | comments | ask | show | jobs | submit login

Copying also means moving to new addresses. What strategies are used to update the referencing pointers to the new location?



The pointers are updated as you copy them. (If you know the types ahead of time, you therefore structure objects so that they consist of runs of pointers and runs of non-pointers.)

Wikipedia has a reasonable explanation of the basic algorithm:

http://en.wikipedia.org/wiki/Cheneys_algorithm

It probably gets more complicated if you try to share it with a non-copying collector, but the basic algorithm is very straightforward to implement.




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

Search: