On Fri, Oct 6, 2017 at 4:15 PM, Manish Goregaokar <manishsm...@gmail.com>
wrote:

> If we do impls in the mallocsizeof crate is we can't make use of the custom
> derive functionality and have to manually write out impls (which in many
> cases won't be possible).


Not being able to use derive doesn't worry me, because it's just a
convenience. I just looked through all the external crates that implement
HeapSizeOf and hardly any are using derive.

Lack of access to internal fields is more of a concern, because that can
make a type impossible to measure. However... a crate can either implement
HeapSizeOf, or it can provide functions that give sufficient internal
access such that HeapSizeOf can be implemented externally. (E.g. in
smallbitvec mbrubeck added a heap_ptr() method on my request:
https://docs.rs/smallbitvec/1.0.7/smallbitvec/struct.SmallBitVec.html#method.heap_ptr.)
But in either case we probably need to control or have influence over the
crate authorship, so to some degree it doesn't really matter.

Nick
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to