home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!wupost!gumby!yale!mintaka.lcs.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.c++
- Subject: Re: Reference counting for vectors, (Tony Hansen's book).
- Message-ID: <TMB.92Aug17173218@arolla.idiap.ch>
- Date: 17 Aug 92 21:32:18 GMT
- References: <1992Aug14.164719.9719@wuecl.wustl.edu>
- <BRISTER.92Aug14170213@tirade.decwrl.dec.com>
- <1992Aug16.081316.27729@mole-end.matawan.nj.us>
- Sender: news@ai.mit.edu
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 31
- In-reply-to: mat@mole-end.matawan.nj.us's message of 16 Aug 92 08:13:16 GMT
-
- mat@mole-end.matawan.nj.us writes:
-
- One possibility, at least of some of them, is to make the management of
- the space a function of the `data structure.' You may have some extra
- objects laying around, but they won't get lost, and there is at least an
- object (the interface object for the data structure as a whole) whose
- lifetime bounds the lifetime of the objects `within.'
-
- These value-is-the-only-thing-of-interest data structures (representation
- schemes) are precisely those for which GC is needed and for which it is
- well-suited.
-
- Meta-discussion: This seems to me so awfully obvious that it hurts to
- write it every few months, yet it hasn't been refuted (at least not to
- my satisfaction), nor have the conclusions which seem to me obvious been
- accepted. What am I not seeing?
-
- You are not seeing that people may not have the memory for those "few
- extra objects" because the lifetime of the containing object may be
- much longer than the lifetime of all the bits and pieces that make it
- up. In fact, often the "containing object" is simply the whole
- program, and its lifetime is until it runs out of memory.
-
- Also, you got it backwards. The need for true GC arises precisely when
- object identies (pointers, addresses, aliasing) matter. If only the
- value of an object matters, you can avoid the need for garbage
- collection trivially via copying or reference counting on assignment
- and initialization (although a real garbage collector is empirically
- still more efficient in most cases).
-
- Thomas.
-