[GAP] unbounded strings package
Thomas Quinot
quinot at adacore.com
Thu Sep 22 15:29:12 CEST 2005
* Ted Baker, 2005-09-22 :
> In class, I used the package Ada.Strings.Unbounded as an example of
> how to use controlled types. I ran into a surprise. Am I blind, or
> does this leak storage?
I don't think so. The previous value of the assigned variable (the value
being overwritten) has been finalized prior to the Adjust call. For the
execution of 'X := Y;', the sequence is as follows:
Finalize (X);
<copy data from Y to X>
Adjust (X);
Thomas.
--
Thomas Quinot, Ph.D. ** quinot at adacore.com ** Senior Software Engineer
AdaCore -- Paris, France -- New York, USA
More information about the GAP
mailing list