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: Garbage Collection for C++
- Message-ID: <1992Aug19.180252.12942@mole-end.matawan.nj.us>
- Summary: Reliability
- Organization: :
- References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <DAVEG.92Aug17231725@synaptx.synaptics.com>
- Date: Wed, 19 Aug 1992 18:02:52 GMT
- Lines: 35
-
- In article <DAVEG.92Aug17231725@synaptx.synaptics.com>, daveg@synaptics.com (Dave Gillespie) writes:
- > In article <1992Aug16.075804.27511@mole-end.matawan.nj.us> mat@mole-end.matawan.nj.us writes:
-
- > Suppose you have an existing C++ program. Suppose there is an object
- > in that program's memory that has been allocated and which no longer
- > has any references to it of any sort, and which has not been deleted
- > explicitly. Most people would consider that a bug; ... your program
- > is not planning on deleting the object because it no longer has any
- > references to it. Is there really so much harm in allowing the C++
- > runtime system to delete the object in that circumstance? If you left
- > the object dangling and it had a destructor that had a noticeable
- > effect on the rest of the program, you almost certainly had a bug anyhow.
-
- Is there really so much harm in allowing the C++ runtime
- system to delete the object in that circumstance?
-
- You've answered your own question in the negative. If the destructor
- has an effect on the program's output, and it is accidentally called
- by the GC instead of by its proper deletion, the program's output will
- depend on the exact properties of the GC system and the exact sequencing
- of internal states of the program and of the program's runtime internals'
- states. It might work correctly by accident in testing, and fail
- disastrously in service.
-
- Allowing GC to operate destructors is not safe.
-
- Not allowing GC to operate destructors does not suit C++'s model of
- execution.
-
- Think about it.
- --
- (This man's opinions are his own.)
- From mole-end Mark Terribile
-
- mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
-