Re: the garbage collector

From: Skybuck Flying (nospam_at_hotmail.com)
Date: 04/08/04


Date: Thu, 8 Apr 2004 19:57:39 +0200


"Rob Kennedy" <me3@privacy.net> wrote in message
news:c53vkk$2adbrt$2@ID-220940.news.uni-berlin.de...
> Skybuck Flying wrote:
> > Are linked lists still possible ?
> >
> > I think so... but all the references of the list will probably be
updated...
> > that could become expensive with large lists :) (many nodes :) )
>
> Linked lists are still possible. Each node object would hold a reference
> to the next node object. If the garbage collector at some point decides
> that it needs to move one of those nodes, it would also update the
> reference held by the other node. Totally and completely transparent to
> the programmer since the exact value of the reference is unimportant.

Hmm.. Yes, good point... It would probably only need to move one single node
and update only a few references.

Probably the node that was added to the list... since all the other nodes
would probably already exist in generation 1 or 2 :)

Skybuck =D



Relevant Pages

  • Re: the garbage collector
    ... Skybuck Flying wrote: ... Linked lists are still possible. ... Each node object would hold a reference ...
    (alt.comp.lang.borland-delphi)
  • Re: Linked list
    ... > preparing for an interview. ... > The only reference MSDN gives for using ILIST is for the Listbox control. ... for linked lists ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... >>linked lists. ... I don't know if there is any authority for such a ... > A reasonably authoritative definition is given at ... I can image I'd have been jumped on, and I am not sure this reference ...
    (comp.programming)
  • Re: passing char arrays by reference
    ... There are other contexts in which "pointer" and ... pass by reference. ... you can implement linked lists by careful use of pointers. ... Linked lists, I'll grant you - but pass-by-reference in C? ...
    (comp.lang.c)
  • Re: passing char arrays by reference
    ... There are other contexts in which "pointer" and ... You can pass a reference in C, ... Similarly, C doesn't directly support linked lists, but you can ...
    (comp.lang.c)