On Tue, Dec 23, 2014 at 1:03 PM, Jeff Walden <jwalden+...@mit.edu> wrote: > On 12/23/2014 10:48 AM, L. David Baron wrote: >> Our convention has always been to pass raw pointers, generally with >> the assumption that the caller is expected to ensure the pointer >> lives across the function call. > > Like Eric, I would like us to move away from this convention over time, or at > least stay away from it in the places that are fresher and better-adjusted.
As long as we can do that without incurring extra overhead. An addref/release pair is fairly expensive for objects that are cycle collected. I guess passing references to an nsRef/COMPtr is a way to avoid passing a raw pointer while also avoiding extra addrefs/releases. But it's pretty ugly and also has a runtime cost. / Jonas _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform