On Fri, Oct 6, 2017 at 2:33 PM, Xidorn Quan <m...@upsuper.org> wrote:
> > There are multiple Servo dependencies on crates.io depend on heapsize. > [1] How are they handled at the moment? And what would we do to them in > the future with the second option? > > [1] https://crates.io/crates/heapsize/reverse_dependencies > Good question. There are two ways for the HeapSizeOf trait to be implemented for a type Foo. (1) Foo's crate depends on heapsize, in which case Foo's crate can implement HeapSizeOf itself. The crates at that link above (app_units, euclid, url) are examples. The advantage of this option is that the HeapSizeOf trait can access non-public fields of types. (2) Foo's crate doesn't depend on heapsize, in which case a different crate must implement HeapSizeOf for Foo. This could be the heapsize crate itself -- as is done for all the standard types like Vec and HashMap -- or it could be a different crate. The advantage of this option is that you don't depend on heapsize. If we went with the second option from my original mail (i.e. stop using heapsize) then it would probably make sense to deprecate heapsize entirely, stop those crates from depending on it, and implement the MallocSizeOf trait for those crates' types within Servo. Nick Nick _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo