Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: Smart pointers and stupid people (was: garbage collection...) Message-ID: <70776@microsoft.UUCP> Date: 19 Feb 91 18:03:25 GMT References: <3779@lupine.NCD.COM> <70606@microsoft.UUCP> <3945@lupine.NCD.COM> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Distribution: comp Organization: Microsoft Corp., Redmond WA Lines: 54 In article <3945@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: |In article <70606@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes: |+In article <3779@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes: |+ |+|Remember, C++ objects don't move. |+ |+Essentially, GC proposals for C++ fall into two camps: |+ |+1) Those GC techniques that don't move C++ objects. |+ |+2) Those GC techniques that do move C++ objects. | |Jim Adcock (and others) have shown an inability to grasp the meaning of |a simple sentence written in plain english. | |Read my lips: C++ objects do not move. I fully understand what you're saying Ron -- what you are saying is not a hard concept to grasp. It's just that I disagree with what you are saying. |You can copy the contents of one C++ object to another C++ object, and |you can then delete the first object, but C++ objects do not "move". | |Oh, you can make tricky use of pointers and maybe even memcpy() to |make it *appear* that a C++ object has moved, but as far as the language |itself is concerned, there is no such thing as a "move object" |operation. The language also doesn't have a concept of "page this region of memory to secondary store" -- but that doesn't mean a particular implementation can't use virtual memory. Usually with hardware assist, some implementations do indeed move objects, but do so in a way that is totally transparent to the language. Thus, the language doesn't care if objects move or not, as long as the requirements of the language are met. I claim implementations of the C++ language are free to move objects or not -- as long as the implementation meets the stated requirements of ARM. Mind you, I think there are going to be some regions of ARM that are very hard to meet using a garbage collected moveable objects strategy -- thus some implementations using GC may do so as an extension to the language, or alternatively as a restriction on some of the traditionally allowed pointer hacks. But then, *any* successful GC scheme is going to have to make some restrictions on the traditionally available set of pointer hacks. In Summary: Ron says C++ objects don't move period. I say C++ objects can move as long as they obey ARM.