|
|
|
|
|
by marshray
5538 days ago
|
|
I've implemented both in C++. See http://svn.boost.org/svn/boost/trunk/boost/smart_ptr/shared_... as an example of reference counting. Add in some atomic increment/decrement primitives and that's literally all there is to implement in one header file. But even the lightest weight GC collector I could make had a significant C++ implementation file with lots of nontrivial pointer operations and loops in it. Even without scanning the stack for root objects, passing them in manually, I still think there's some amount of non-portable code in there. That said, I'm using my GC for new stuff when the objects aren't too temporary. We'll see how it works out. |
|