home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mole-end!mat
- From: mat@mole-end.matawan.nj.us
- Subject: Re: Reference counting for vectors, (Tony Hansen's book).
- Message-ID: <1992Aug16.081316.27729@mole-end.matawan.nj.us>
- Summary: Who is in charge ...
- Organization: :
- References: <1992Aug14.164719.9719@wuecl.wustl.edu> <BRISTER.92Aug14170213@tirade.decwrl.dec.com>
- Date: Sun, 16 Aug 1992 08:13:16 GMT
- Lines: 39
-
- In article <BRISTER.92Aug14170213@tirade.decwrl.dec.com>, brister@decwrl.dec.com (James Brister) writes:
- > On 15 Aug 92 03:22:08 GMT, tmb@arolla.idiap.ch (Thomas M. Breuel) said:
- > > In article <BRISTER.92Aug14110706@tirade.decwrl.dec.com> brister@decwrl.dec.com (James Brister) writes:
-
- > > Using reference counting to get reference semantics on parameter
- > > passing is very confusing indeed (sadly, this bad idea seems to
- > > pervade the C++ literature).
-
- > Perhaps if it's so pervasive then it's not such a bad idea.
-
- > parameter passing was only a simple example, there are lots of cases where
- > multiple objects need to keep track of a piece of data, and unless you're
- > very sure about who is supposed to delete the data and when (non-trivial
- > when the system gets complex), you can get yourself into a lot of trouble.
- > Reference counting can save the day.
-
- This is really the problem. There exist many data structures (representation
- schemes) which deal with values that have to be stored in objects, but that
- don't provide for management of the objects.
-
- 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?
- --
- (This man's opinions are his own.)
- From mole-end Mark Terribile
-
- mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
-