4 ms·
> GC could actually be really useful in C++ Here is a very stable one for C and C++: http://www.hboehm.info/gc/ http://www.hboehm.info/gc/
by AdieuToLogic 11y ago
> GC could actually be really useful in C++
Here is a very stable one for C and C++:
http://www.hboehm.info/gc/ http://www.hboehm.info/gc/
- pjmlp 11y agoIt might be stable, but it surely isn't fast, given it is conservative.
- rurban 11y agoYes, but it is still better than the Go GC. Both are super conservative (i.e. not moving), precise (i.e ptr overhead), and just mark & sweep (i.e. full heap scans). But Boehm-Weiser's GC can parallelize marking, and store and restore the sweep phase for lower latencies, i.e. in incremental mode. http://www.hboehm.info/gc/gcdescr.html http://www.hboehm.info/gc/gcdescr.html Better GC's, Mark & Compact and Copying as used in more mature languages, are still on the horizon for Go. (If you go for larger heaps and more speed). I see it at just 30% done yet. Go controls its ABI, so it can easily use better GC's in the future.
- rurban 11y agoOops, I mixed up the two phases. Marking is incremental (also in v8), and sweeping is parallelizable. http://jayconrod.com/posts/55/a-tour-of-v8-garbage-collection http://jayconrod.com/posts/55/a-tour-of-v8-garbage-collectio... gives a good overview of good GC techniques, championed in earlier lisps and functional languages.