From 8007385585632339088
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f5d433881cc29cff
X-Google-Attributes: gidf78e5,public
From: Barry Margolin <barmar@bbnplanet.com>
Subject: Re: Named return value optimisation- reprise.
Date: 1997/06/23
Message-ID: <5oet82$b5g@tools.bbnplanet.com>#1/1
X-Deja-AN: 252085439
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>
X-Original-Date: 20 Jun 1997 17:38:10 -0400
Organization: BBN Planet, Cambridge, MA
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBM67f1Ey4NqrwXLNJAQFv4wH9He4S6nI3hrXKxz1RHY9BISusChnyXBJx uOqUl/pG1b4xgQKGIxYyuzLDNgh1GkdVcnnI5LY66XXnq48zdoGKWg== =853q
Newsgroups: comp.std.c++
Originator: austern@isolde.mti.sgi.com


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.

-- 
Barry Margolin, barmar@bbnplanet.com
BBN Corporation, Cambridge, MA
Support the anti-spam movement; see <http://www.cauce.org/>
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



