[Ada] Add comments wrt. deallocation of bounded sets/maps
authorRaphael Amiard <amiard@adacore.com>
Thu, 19 Sep 2019 08:13:06 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 19 Sep 2019 08:13:06 +0000 (08:13 +0000)
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

gcc/ada/ChangeLog
gcc/ada/libgnat/a-cbhama.ads
gcc/ada/libgnat/a-cbhase.ads
gcc/ada/libgnat/a-chtgop.ads

index 5ff5f16..f9a8bfe 100644 (file)
@@ -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
index b4d1105..0238548 100644 (file)
@@ -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
index 8f1b886..cb9150b 100644 (file)
@@ -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
index 3bb42fe..6ebb9e5 100644 (file)
@@ -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