CasperLabs / datasize-rs

Heap memory usage estimation
Other
16 stars 13 forks source link

Add DataSize implementations for Box<str> and Box<[T]> #14

Closed alexmaco closed 1 year ago

alexmaco commented 1 year ago

Ran into this limitation while trying to do some memory profiling.

Although less common, Box<str> and Box<[T]> are useful in certain situations. Since they are provided by std, implementing DataSize for them would require a newtype. Providing these implementations out of the box makes for much smoother usage.