home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!microsoft!hexnut!jimad
- From: jimad@microsoft.com (Jim Adcock)
- Subject: Re: Garbage Collection for C++
- Message-ID: <1992Aug25.182943.9266@microsoft.com>
- Date: 25 Aug 92 18:29:43 GMT
- Organization: Microsoft Corporation
- References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <DAVEG.92Aug17231725@synaptx.synaptics.com> <1992Aug19.180252.12942@mole-end.matawan.nj.us>
- Lines: 21
-
- In article <1992Aug19.180252.12942@mole-end.matawan.nj.us> mat@mole-end.matawan.nj.us writes:
- |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.
-
- These same thoughts could be equally applied to the lifetime of temporaries,
- leading to the conclusion that the lifetimes of temporaries ought to be
- the same as for named objects. IE "end of block" [incl. implied block of
- loops and conditionals], and reversed orders of constructing and destructing.
-
-