4 ms·
As another example, Firefox uses "manual reflection" to e.g. build lists of all the smart pointers in some classes. It then uses these lists as part of its "cy
by jlebar 11y ago
As another example, Firefox uses "manual reflection" to e.g. build lists of all the smart pointers in some classes. It then uses these lists as part of its "cycle collector", which breaks cycles in the refcounted graph of objects.
Writing and maintaining these lists is error-prone, and at least used to be a major source of memory leaks. You can imagine writing a static analysis to figure this out, and the Moz folks may have since I last checked, but if the language could do it, that would be so much better...
- pcwalton 11y agoAs a somewhat-related data point, Servo is already using the macro deriving infrastructure of Rust to generate these lists at compile time for its garbage collector.
- dman 11y agoI understand the urge to evangelise, but does Rust have to crop up in every C++ thread?
- kbenson 11y agoIt was in response to a comment that was referring to Firefox. Servo is touted as the eventual replacement of Firefox's rendering engine. It's literally a response to a comment about Mozilla's current practices in this area explaining their proposed future practices. Seems appropriate to me.
- pcwalton 11y agoApologies if I made it seem like evangelism; just wanted to clarify the state of tracing cycle collection in Firefox-related projects.