summaryrefslogtreecommitdiff
path: root/gcc/ada/a-strunb.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 15:52:27 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 15:52:27 +0000
commit20e42bc1b770789e9db37f51ca755d305f5b2eec (patch)
tree7a7289c9b2877f87a4a78f1c91b483f803aa6e9f /gcc/ada/a-strunb.ads
parent57b5da613404a43f2a614b15f24ce6cfb365d601 (diff)
downloadgcc-20e42bc1b770789e9db37f51ca755d305f5b2eec.tar.gz
2005-03-08 Robert Dewar <dewar@adacore.com>
* a-stzunb.adb, a-stzunb.adb a-stzunb.ads, a-stzunb.ads, a-stwiun.ads, a-stwiun.adb, a-strunb.ads, a-strunb.adb: Move Realloc_For_Chunk to private part of package. New subprograms for AI-301 * a-szuzti.adb, a-suteio.adb, a-swuwti.adb: Improve efficiency of Get_Line procedure. Avoid unnecessary use of Get/Set_Wide_String git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-strunb.ads')
-rw-r--r--gcc/ada/a-strunb.ads25
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ada/a-strunb.ads b/gcc/ada/a-strunb.ads
index c974b879e27..9c7ffcf9506 100644
--- a/gcc/ada/a-strunb.ads
+++ b/gcc/ada/a-strunb.ads
@@ -405,18 +405,31 @@ private
pragma Stream_Convert (Unbounded_String, To_Unbounded, To_String);
pragma Finalize_Storage_Only (Unbounded_String);
+ -- Finalization is required only for freeing storage
procedure Initialize (Object : in out Unbounded_String);
procedure Adjust (Object : in out Unbounded_String);
procedure Finalize (Object : in out Unbounded_String);
- -- Note: the following declaration is illegal since library level
- -- controlled objects are not allowed in preelaborated units. See
- -- AI-161 for a discussion of this issue and an attempt to address it.
- -- Meanwhile, what happens in GNAT is that this check is omitted for
- -- internal implementation units (see check in sem_cat.adb).
+ procedure Realloc_For_Chunk
+ (Source : in out Unbounded_String;
+ Chunk_Size : Natural);
+ pragma Inline (Realloc_For_Chunk);
+ -- Adjust the size allocated for the string. Add at least Chunk_Size so it
+ -- is safe to add a string of this size at the end of the current content.
+ -- The real size allocated for the string is Chunk_Size + x of the current
+ -- string size. This buffered handling makes the Append unbounded string
+ -- routines very fast. This spec is in the private part so that it can be
+ -- accessed from children (e.g. from Unbounded.Text_IO).
Null_Unbounded_String : constant Unbounded_String :=
- (AF.Controlled with Reference => Null_String'Access, Last => 0);
+ (AF.Controlled with
+ Reference => Null_String'Access,
+ Last => 0);
+ -- Note: this declaration is illegal since library level controlled
+ -- objects are not allowed in preelaborated units. See AI-161 for a
+ -- discussion of this issue and an attempt to address it. Meanwhile,
+ -- what happens in GNAT is that this check is omitted for internal
+ -- implementation units (see check in sem_cat.adb).
end Ada.Strings.Unbounded;