3 ms·
Sure, and there are a few hooks for one in the C++ standard library e.g. std::declare_reachable [1], although it doesn't include an actual implementation. Only
by quietbritishjim 7y ago
Sure, and there are a few hooks for one in the C++ standard library e.g. std::declare_reachable [1], although it doesn't include an actual implementation. Only mark and sweep is feasible, not mark and compact, for obvious reasons [2]. Here's a mention of garbage collection Stroustrop's old C++11 FAQ [3]
[1] https://en.cppreference.com/w/cpp/memory/gc/declare_reachable https://en.cppreference.com/w/cpp/memory/gc/declare_reachabl...
[2] https://herbsutter.com/2011/10/25/garbage-collection-synopsis-and-c/ https://herbsutter.com/2011/10/25/garbage-collection-synopsi...
[3] https://web.archive.org/web/20120228143039/http://www2.research.att.com/~bs/C++0xFAQ.html#gc-abi https://web.archive.org/web/20120228143039/http://www2.resea...