aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Amiard <amiard@adacore.com>2019-09-19 08:13:06 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-09-19 08:13:06 +0000
commit3aacb9ed526c68e49424ec4dc4833de8353d2a7c (patch)
tree318d65dbd8df51586a71e1713fd08ec9e46fcaed
parent4af04d04c427e2ca78bb988cf6b1ad209a99a142 (diff)
downloadgcc-3aacb9ed526c68e49424ec4dc4833de8353d2a7c.zip
gcc-3aacb9ed526c68e49424ec4dc4833de8353d2a7c.tar.gz
gcc-3aacb9ed526c68e49424ec4dc4833de8353d2a7c.tar.bz2
[Ada] Add comments wrt. deallocation of bounded sets/maps
2019-09-19 Raphael Amiard <amiard@adacore.com> gcc/ada/ * libgnat/a-cbhama.ads, libgnat/a-cbhase.ads, libgnat/a-chtgop.ads (Clear): Refine comments From-SVN: r275936
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/libgnat/a-cbhama.ads3
-rw-r--r--gcc/ada/libgnat/a-cbhase.ads3
-rw-r--r--gcc/ada/libgnat/a-chtgop.ads5
4 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5ff5f16..f9a8bfe 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-19 Raphael Amiard <amiard@adacore.com>
+
+ * libgnat/a-cbhama.ads, libgnat/a-cbhase.ads,
+ libgnat/a-chtgop.ads (Clear): Refine comments
+
2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Restore_Private_Views): Comment out new code
diff --git a/gcc/ada/libgnat/a-cbhama.ads b/gcc/ada/libgnat/a-cbhama.ads
index b4d1105..0238548 100644
--- a/gcc/ada/libgnat/a-cbhama.ads
+++ b/gcc/ada/libgnat/a-cbhama.ads
@@ -107,7 +107,8 @@ package Ada.Containers.Bounded_Hashed_Maps is
-- Equivalent to Length (Container) = 0
procedure Clear (Container : in out Map);
- -- Removes all of the items from the map
+ -- Removes all of the items from the map. This will deallocate all memory
+ -- associated with this map.
function Key (Position : Cursor) return Key_Type;
-- Returns the key of the node designated by the cursor
diff --git a/gcc/ada/libgnat/a-cbhase.ads b/gcc/ada/libgnat/a-cbhase.ads
index 8f1b886..cb9150b 100644
--- a/gcc/ada/libgnat/a-cbhase.ads
+++ b/gcc/ada/libgnat/a-cbhase.ads
@@ -120,7 +120,8 @@ package Ada.Containers.Bounded_Hashed_Sets is
-- Equivalent to Length (Container) = 0
procedure Clear (Container : in out Set);
- -- Removes all of the items from the set
+ -- Removes all of the items from the set. This will deallocate all memory
+ -- associated with this set.
function Element (Position : Cursor) return Element_Type;
-- Returns the element of the node designated by the cursor
diff --git a/gcc/ada/libgnat/a-chtgop.ads b/gcc/ada/libgnat/a-chtgop.ads
index 3bb42fe..6ebb9e5 100644
--- a/gcc/ada/libgnat/a-chtgop.ads
+++ b/gcc/ada/libgnat/a-chtgop.ads
@@ -107,8 +107,9 @@ package Ada.Containers.Hash_Tables.Generic_Operations is
procedure Clear (HT : in out Hash_Table_Type);
-- Deallocates each node in hash table HT. (Note that it only deallocates
- -- the nodes, not the buckets array.) Program_Error is raised if the hash
- -- table is busy.
+ -- the nodes, not the buckets array. Also note that for bounded containers,
+ -- the buckets array is not dynamically allocated). Program_Error is raised
+ -- if the hash table is busy.
procedure Move (Target, Source : in out Hash_Table_Type);
-- Moves (not copies) the buckets array and nodes from Source to