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