I think the most extreme variant of this sharing is when you build up a
"binary tree" that keeps pointing both left and right pointers to the same
underlying structure. A tree of size K is supposed to have around 2^K nodes
but in reality the memory layout is around K nodes in size. Suppose we
defin
On Thu, Apr 13, 2017 at 9:31 AM, wrote:
> https://play.golang.org/p/swRxxCbb65
>
> Surely s1 uses more than 8 bytes.
Unfortunately, your question is not well defined. s1 itself is 8
bytes. If you write `s3 := s1` and ask for the size of s3, it too
will be 8 bytes. There is also string data in
On Thu, Apr 13, 2017 at 9:31 AM, wrote:
> https://play.golang.org/p/swRxxCbb65
>
> Surely s1 uses more than 8 bytes.
Unfortunately, your question is not well defined. s1 itself is 8
bytes. If you write `s3 := s1` and ask for the size of s3, it too
will be 8 bytes. There is also string data in
On Thu, Apr 13, 2017 at 6:31 PM wrote:
> https://play.golang.org/p/swRxxCbb65
>
> Surely s1 uses more than 8 bytes.
no
--
-j
--
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, s
https://play.golang.org/p/swRxxCbb65
Surely s1 uses more than 8 bytes.
On Thursday, April 13, 2017 at 11:28:39 AM UTC-5, Jan Mercl wrote:
>
> On Thu, Apr 13, 2017 at 6:24 PM AWildTyphlosion <
> sdi...@watchtower-security.com > wrote:
>
> > I'm trying to figure out how much memory a value. Anyone
On Thu, Apr 13, 2017 at 6:24 PM AWildTyphlosion <
sdic...@watchtower-security.com> wrote:
> I'm trying to figure out how much memory a value. Anyone have a clue how
to?
unsafe.Sizeof/reflect.Type.Size
--
-j
--
You received this message because you are subscribed to the Google Groups
"golang
I'm trying to figure out how much memory a value. Anyone have a clue how to?
--
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 golang-nuts+unsubscr...@googlegroups