From -6142598476050600231
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f5d433881cc29cff
X-Google-Attributes: gidf78e5,public
From: bparker@gil.com.au (Brian Parker)
Subject: Re: Named return value optimisation- reprise.
Date: 1997/06/24
Message-ID: <33af2d84.11809049@news.ipswich.gil.com.au>#1/1
X-Deja-AN: 252167549
References: <33a345bf.7425526@news.ipswich.gil.com.au> <5o7lbs$3a6@mulga.cs.mu.OZ.AU> <01bc7bf8$bb2c9be0$a56dadce@azguard> <33a885f3.6004413@news.ipswich.gil.com.au> <5oet82$b5g@tools.bbnplanet.com>
X-Original-Date: Tue, 24 Jun 1997 03:34:53 GMT
Organization: Global Info-Links News Server
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBM69Q/OEDnX0m9pzZAQHE9AGAjmYDh25SmUzomt9QjudNRffhZTrhCYB9 Te+gGCZp/n8u2rBZb/yYV6Rw9jk7XxQY =xCJm
Newsgroups: comp.std.c++
Originator: fjh@mundook.cs.mu.OZ.AU


On 23 Jun 1997 13:42:59 PDT, Barry Margolin <barmar@bbnplanet.com>
wrote:

>In article <33a885f3.6004413@news.ipswich.gil.com.au>,
>Brian Parker <bparker@gil.com.au> wrote:
>>Actually, it's not even absolutely clear in the case of objects about
>>to go out of scope- in a garbage-collected implementation memory can
>>be retained beyond the local scope (or, as in the MV++ example, some
>>of the object's memory may be statically allocated).
>
>Even in a GC'ed implementation, you can't refer to automatic objects once
>the block they were allocated in has exited.  GC permits an implementation
>to reclaim memory once it has determined that it can't be accessed, but
>doesn't require it to retain memory after an object has been declared
>inaccessible (either by going out of scope or by an explicit call to free()
>or delete).  While it's possible for an implementation to make the explicit
>action no-ops, and use GC for all reclamation (a la Lisp), as far as the
>language semantics are concerned this lazy reclamation doesn't exist.

I was unclear in my original posting- what I meant to say was that the
internal dynamically-allocated memory of local objects could be
retained by a GC, not that the automatic object itself was affected by
the garbage collector (also note that I am not particularly defending
that as a good design- I'm just pointing out that that it can happen).

,Brian Parker (bparker@gil.com.au)
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



