home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12317 < prev    next >
Encoding:
Text File  |  1992-08-13  |  2.0 KB  |  47 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!gatech!rpi!batcomputer!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
  3. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  4. Subject: Re: Garbage Collection for C++
  5. Message-ID: <1992Aug13.151749.15679@ucc.su.OZ.AU>
  6. Sender: news@ucc.su.OZ.AU
  7. Nntp-Posting-Host: extro.ucc.su.oz.au
  8. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  9. References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <3907@starlab.UUCP>
  10. Date: Thu, 13 Aug 1992 15:17:49 GMT
  11. Lines: 34
  12.  
  13. In article <3907@starlab.UUCP> mi@starlab.UUCP (Michael Hoennig) writes:
  14. >In article <1992Aug6.014619.2111@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  15. >
  16. >>GC classes cannot be allocated on the stack or statically,
  17. >>so when one is, it is silently converted to a GC pointer
  18. >>to an object.
  19. >
  20. >>Pointers to GC class objects will be GC pointers.
  21. >>GC pointers are like classes, they have built in destructors and
  22. >>constructors so they can't just disappear.
  23. >
  24. >I think this is a neverending loop. If pointers to GC class objects will be
  25. >GC pointers too, they will be silently converted to a GC pointer (which is
  26. >a pointer to a GC class) and must be silently converted to a GC ...
  27. >
  28. >=> GC class objects must be allocatable on the stack - but the compiler
  29. >must recocnize this.
  30. >
  31.     ?? GC objects are allowed only in the GC heap. Pointers
  32. to these a possibly special, but they can be static, auto, or inside
  33. objects on the GC heap, and probably with some loss of security
  34. they could be allowed in objects not on the GC heap.
  35.  
  36.     GC pointers are like *ordinary* C++ classes, not GC classes.
  37. If GC objects were allowed on the stack, they would have to be
  38. copied when the lexical scope was exited if there were still
  39. existant pointers to them. So why not just allocated them
  40. on the GC heap in the first place?
  41.  
  42. -- 
  43. ;----------------------------------------------------------------------
  44.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  45.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  46. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  47.