Re: [go-nuts] [generics] Data structures and the garbage collector

2020-07-11 Thread t hepudds
Hello Markus, > "But apparently (see Ian's answer) this is not the case, and the GC always needs to trace all elements, keys and values." I think Ian said something a bit different from what you said there. As far as I understand, the GC does not scan the keys and values of a map if they are n

Re: [go-nuts] [generics] Data structures and the garbage collector

2020-07-10 Thread Markus Heukelom
> Many data structures are implemented using pointers. How does this perform >> wrt garbage collecting? For example take any data structure that uses some >> tree of nodes, or even simpler just a singly linked list: there is one >> pointer from the left node to the next. Wouldn't this incur hu

Re: [go-nuts] [generics] Data structures and the garbage collector

2020-07-10 Thread Jesper Louis Andersen
On Thu, Jul 9, 2020 at 6:40 PM Markus Heukelom wrote: > Many data structures are implemented using pointers. How does this perform > wrt garbage collecting? For example take any data structure that uses some > tree of nodes, or even simpler just a singly linked list: there is one > pointer from t

Re: [go-nuts] [generics] Data structures and the garbage collector

2020-07-09 Thread Ian Lance Taylor
On Thu, Jul 9, 2020 at 9:40 AM Markus Heukelom wrote: > > Many data structures are implemented using pointers. How does this perform > wrt garbage collecting? For example take any data structure that uses some > tree of nodes, or even simpler just a singly linked list: there is one > pointer fr

[go-nuts] [generics] Data structures and the garbage collector

2020-07-09 Thread Markus Heukelom
Hi, Many data structures are implemented using pointers. How does this perform wrt garbage collecting? For example take any data structure that uses some tree of nodes, or even simpler just a singly linked list: there is one pointer from the left node to the next. Wouldn't this incur huge GC (