comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: GNAT - return by anonymous access
Date: Tue, 20 Dec 2011 17:18:55 -0600
Date: 2011-12-20T17:18:55-06:00	[thread overview]
Message-ID: <jcr551$2jq$1@munin.nbi.dk> (raw)
In-Reply-To: b896b012-1f49-494c-a585-3d37a7c0965a@q9g2000yqe.googlegroups.com

"Shark8" <onewingedshark@gmail.com> wrote in message 
news:b896b012-1f49-494c-a585-3d37a7c0965a@q9g2000yqe.googlegroups.com...

>Hm, so then are local pools useless? Or do they have their place?
>I read some of the rational[e/ization] for them and it seems
>reasonable, but I've not actually used them.

A local pool is fine, so long as it is tied to a local pool-specific access 
type. Using a pool (any pool!) with general access type is asking for 
trouble. And anonymous access types are general access types by definition.

It's best to do all of your allocation with a named pool-specific access 
type, and then (if necessary) convert the value to a more flexible general 
access type (including the anonymous ones). That way, you'll at least know 
how long the access value is supposed to live, and have a means of freeing 
it explicitly if needed.

Personally, I'd just avoid anonymous access types, but I'm not going to go 
so far as to recommend that (there are things that are hard to do any other 
way).

                                        Randy.





  reply	other threads:[~2011-12-20 23:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 19:17 GNAT - return by anonymous access Simon Belmont
2011-12-17 19:51 ` Simon Wright
2011-12-18  9:08 ` Georg Bauhaus
2011-12-19 23:46 ` Randy Brukardt
2011-12-20  0:14   ` Shark8
2011-12-20 23:18     ` Randy Brukardt [this message]
2011-12-21  0:44       ` Simon Belmont
2011-12-21  7:29         ` AdaMagica
2011-12-21 11:05           ` Georg Bauhaus
2011-12-21 11:43             ` AdaMagica
2011-12-21 12:05               ` Georg Bauhaus
2011-12-22  0:33                 ` Randy Brukardt
2011-12-22  0:33           ` Simon Belmont
2011-12-22  7:11             ` Adam Beneschan
2011-12-22 22:11               ` Simon Belmont
2011-12-23  0:56                 ` Randy Brukardt
2011-12-23 13:20                   ` Simon Belmont
2011-12-27 23:51                     ` Randy Brukardt
2011-12-20 23:53 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox