comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: containers and garbage collections.
Date: Sat, 13 Sep 2003 11:37:28 +0200
Date: 2003-09-13T11:37:28+02:00	[thread overview]
Message-ID: <4397327.CqdvVbT517@linux1.krischik.com> (raw)
In-Reply-To: uy8wuvu0j.fsf@nasa.gov

Stephen Leake wrote:

> Martin Krischik <krischik@users.sourceforge.net> writes:

> Do either of your containers rely on the garbage collected storage
> pool?

No, AdaCL rely on the garbage collected storage only at two places: The Text
Search and Replace Queues will leak less 16 bytes per File processed when
garbage collection is off.

The extended booch components will not leak memory when garbage collection
has been switched off. At least to my knowlege.
 
>> Both can't be done with C++ templates - so we should not take the
>> all mighty STL as an example.
 
> Hmm. I haven't really looked, but I'd be very surprised if an STL
> container can't contain STL Strings.

Ahh, Yes. but STL strings are like Unbounded_Strings. I was speaking of
fixed strings like char []. Support for open arrays is not the teriffic in
C++.

> Of course, there is no such thing as "indefinite abstract tagged
> private" in C++. The closest thing is a class with only pure virtual
> member functions; that leaves out the "indefinite" part (implied by
> the (<>)). So to say "STL" can't do that isn't saying much; you're
> really just saying "C++ can't do that".

No, you misunderstood. In Ada you can say:

Y: Child_of_Some_Abscract;
X : Some_Abscract_Access := new Some_Abscract'(Child_of_Some_Abscract);

and X will point to a copy of Y. In C++ you will need some form of cloning
facility.

> I'm not clear what you mean by "don't take the STL as an example".
> Clearly the STL is limited by the expressiveness of C++; Ada is
> better. But the STL has proven to be a very useful library, because of
> the functionality it provides; it is reasonable to design an Ada
> library that has similar functionality, but takes full advantage of
> Ada to do it. I think that is your real goal?

Yes, I agree on that. Prehaps I did not make myself clear enough.

With Regards

Martin 

-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




  reply	other threads:[~2003-09-13  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-12 15:32 containers and garbage collections Martin Krischik
2003-09-12 16:41 ` Stephen Leake
2003-09-13  9:37   ` Martin Krischik [this message]
2003-09-13  3:33 ` Matthew Heaney
2003-09-13  9:45   ` Martin Krischik
2003-09-13 17:10     ` Matthew Heaney
2003-09-15 13:47     ` Dmitry A. Kazakov
2003-09-15 23:11       ` Matthew Heaney
2003-09-16 17:59         ` Martin Krischik
replies disabled

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