Search code examples
c++garbage-collectiongarbage

Getting roots for Mark Sweep Garbage Collector C++


My goal is to create simple mark-sweep garbage collector in C++ language. First step in mark phase is to get all roots(thread stacks, global variables ...). So, how can i get or find that roots in my c++ code?


Solution

  • There is a talk that Herb Sutter gave at CPPCon 2016 that explains exactly how to correctly make a mark-n-sweep garbage collector in C++: Talk