home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 12966 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.6 KB

  1. Path: sparky!uunet!igor!thor!rmartin
  2. From: rmartin@thor.Rational.COM (Bob Martin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Garbage Collection for C++
  5. Message-ID: <rmartin.714925423@thor>
  6. Date: 27 Aug 92 14:23:43 GMT
  7. References: <1992Aug25.183619.9541@microsoft.com> <1992Aug26.121040.8995@ericsson.se>
  8. Sender: news@Rational.COM
  9. Lines: 27
  10.  
  11. jonas@beppe.ericsson.se (Jonas Nygren) writes:
  12.  
  13. >I believe Apples C++ supports moveable objects. If I am correct pointers in this
  14. >C++ are really pointers to handles which in their turn points to the objects
  15. >current location. This would imply that each dereference in user code p->x
  16. >would be translated by the compiler into (*p)->x.
  17.  
  18. >Does anybody know if Apple's C++ works this way? If so, how do they handle
  19. >pointers to objects on the stack.
  20.  
  21. I don't know about MPW C++, but Think C (Kind of a (C++)--) does have
  22. the ability to treat handles as pointers.  Handles are master pointers
  23. which in turn point to the movable block.  When the block gets moved,
  24. the contents of the master pointer change, but the handle still points
  25. to the same master pointer.
  26.  
  27. This works quite well in the Mac O/S.  The syntactic sugar that lets
  28. Handles be treated as pointers removes a lot of the bugs which used to
  29. occur when programmers dereferenced a handle, and kept the pointer to
  30. the object beyond the point where the object got moved.
  31.  
  32.  
  33. --
  34. Robert Martin                        Training courses offered in:
  35. R. C. M. Consulting                       Object Oriented Analysis
  36. 2080 Cranbrook Rd.                        Object Oriented Design
  37. Green Oaks, Il 60048 (708) 918-1004       C++
  38.