When initializing variables, If the copies of values are made, their
memory usages will be:
var a = [3]int8{2, 4, 6}
> | |
3 bytes + 3 bytes = 6 bytes
var b = []int8[2, 4, 6}
> | |
> 24 bytes + 24 bytes = 48 bytes
var c = func() {}
> | |
> 8 bytes + 8 bytes = 16 bytes
var d = struct{n1 int, n2 int}{1, 2}
> | |
> 16 bytes + 16 bytes = 32 bytes
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.