comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: ada.strings.unbounded "free" and "String_Access"
Date: 2000/03/10
Date: 2000-03-10T00:00:00+00:00	[thread overview]
Message-ID: <8a9gc6$dlb$1@nnrp1.deja.com> (raw)
In-Reply-To: 38C6D4DE.D482DA0C@acm.org

In article <38C6D4DE.D482DA0C@acm.org>,
  jrcarter@acm.org wrote:
> Nick Roberts wrote:
> >
> > The purpose is simply this: if Unbounded_String doesn't give you
> > quite enough flexibility in certain parts of your code (e.g. you
> > need more speed), you can use the type String_Access instead.
> >

> You don't need an access type for this (in Ada, you rarely need access
> types at all). You can simply operate on the String returned by
> To_String:

You miss Nick's point. Doing that would cause the entire contents of the
string to get copied. For a somewhat longish string, passing the pointer
of the String_Access around instead would be significantly faster. I
just yesterday had to perform that very optimization in some code of
ours that is running at 60Hz with hard realtime performance
requirements.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-03-10  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-07  0:00 ada.strings.unbounded "free" and "String_Access" Al Johnston
2000-03-08  0:00 ` Nick Roberts
2000-03-08  0:00   ` Jeff Carter
2000-03-10  0:00     ` Ted Dennison [this message]
2000-03-11  0:00   ` Robert A Duff
2000-03-13  0:00     ` Robert Dewar
2000-03-08  0:00 ` Robert A Duff
2000-03-09  0:00 ` Al Johnston
replies disabled

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