home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 12895 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.4 KB  |  32 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: Garbage Collection for C++
  5. Message-ID: <1992Aug25.182943.9266@microsoft.com>
  6. Date: 25 Aug 92 18:29:43 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <DAVEG.92Aug17231725@synaptx.synaptics.com> <1992Aug19.180252.12942@mole-end.matawan.nj.us>
  9. Lines: 21
  10.  
  11. In article <1992Aug19.180252.12942@mole-end.matawan.nj.us> mat@mole-end.matawan.nj.us writes:
  12. |You've answered your own question in the negative.  If the destructor
  13. |has an effect on the program's output, and it is accidentally called
  14. |by the GC instead of by its proper deletion, the program's output will
  15. |depend on the exact properties of the GC system and the exact sequencing
  16. |of internal states of the program and of the program's runtime internals'
  17. |states.  It might work correctly by accident in testing, and fail
  18. |disastrously in service.
  19. |
  20. |Allowing GC to operate destructors is not safe.
  21. |
  22. |Not allowing GC to operate destructors does not suit C++'s model of
  23. |execution.
  24. |
  25. |Think about it.
  26.  
  27. These same thoughts could be equally applied to the lifetime of temporaries,
  28. leading to the conclusion that the lifetimes of temporaries ought to be
  29. the same as for named objects.  IE "end of block" [incl. implied block of
  30. loops and conditionals], and reversed orders of constructing and destructing.
  31.  
  32.