Re: [go-nuts] Determining memory use of structs containing slices

2018-09-04 Thread Jan Mercl
On Tue, Sep 4, 2018 at 10:29 AM Ingo Jaeckel wrote: > It seems the length of a slice is not considered by unsafe.SizeOf . Rightfully so. The size of a slice is a compile-time constant. > I assume this is a side effect of .SizeOf being evaluated at compile

[go-nuts] Determining memory use of structs containing slices

2018-09-04 Thread Ingo Jaeckel
https://play.golang.org/p/7ZAN9AuEGfD It seems the length of a slice is not considered by unsafe.SizeOf . I assume this is a side effect of .SizeOf being evaluated at compile time? What are other idiomatic ways to determine the runtime memory use of a str