Commit f97ccb3a by Bob Duff Committed by Arnaud Charlet

a-cihama.ads, [...] (Next): Applied pragma Inline.

2007-08-14  Bob Duff  <duff@adacore.com>

	* a-cihama.ads, a-cidlli.ads, a-chtgop.ads, a-chtgop.adb, a-cdlili.ads, 
	a-cihase.adb, a-cihase.ads, a-cohase.adb, a-cohase.ads, a-ciorma.ads, 
	a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-ciorse.ads, a-cohama.ads, 
	a-cohata.ads, a-convec.adb, a-coinve.ads, a-coinve.adb, a-convec.ads,
	a-coorse.ads (Next): Applied pragma Inline.
	Make all Containers packages Remote_Types (unless they are already
	Pure).
	(Previous): applied pragma Inline
	(Elements_Type): is now a record instead of an array

From-SVN: r127441
parent b11e8d6f
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -44,6 +44,7 @@ generic ...@@ -44,6 +44,7 @@ generic
package Ada.Containers.Doubly_Linked_Lists is package Ada.Containers.Doubly_Linked_Lists is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
type List is tagged private; type List is tagged private;
pragma Preelaborable_Initialization (List); pragma Preelaborable_Initialization (List);
...@@ -204,6 +205,10 @@ package Ada.Containers.Doubly_Linked_Lists is ...@@ -204,6 +205,10 @@ package Ada.Containers.Doubly_Linked_Lists is
end Generic_Sorting; end Generic_Sorting;
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -37,8 +37,10 @@ with System; use type System.Address; ...@@ -37,8 +37,10 @@ with System; use type System.Address;
package body Ada.Containers.Hash_Tables.Generic_Operations is package body Ada.Containers.Hash_Tables.Generic_Operations is
procedure Free is type Buckets_Allocation is access all Buckets_Type;
new Ada.Unchecked_Deallocation (Buckets_Type, Buckets_Access); -- Used for allocation and deallocation (see New_Buckets and
-- Free_Buckets). This is necessary because Buckets_Access has an empty
-- storage pool.
------------ ------------
-- Adjust -- -- Adjust --
...@@ -66,7 +68,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -66,7 +68,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
-- source table. This has the benefit that when iterating, elements of -- source table. This has the benefit that when iterating, elements of
-- the target are delivered in the exact same order as for the source. -- the target are delivered in the exact same order as for the source.
HT.Buckets := new Buckets_Type (Src_Buckets'Range); HT.Buckets := New_Buckets (Length => Src_Buckets'Length);
for Src_Index in Src_Buckets'Range loop for Src_Index in Src_Buckets'Range loop
Src_Node := Src_Buckets (Src_Index); Src_Node := Src_Buckets (Src_Index);
...@@ -220,7 +222,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -220,7 +222,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
procedure Finalize (HT : in out Hash_Table_Type) is procedure Finalize (HT : in out Hash_Table_Type) is
begin begin
Clear (HT); Clear (HT);
Free (HT.Buckets); Free_Buckets (HT.Buckets);
end Finalize; end Finalize;
----------- -----------
...@@ -245,6 +247,21 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -245,6 +247,21 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
end loop; end loop;
end First; end First;
------------------
-- Free_Buckets --
------------------
procedure Free_Buckets (Buckets : in out Buckets_Access) is
procedure Free is
new Ada.Unchecked_Deallocation (Buckets_Type, Buckets_Allocation);
begin
-- Buckets must have been created by New_Buckets. Here, we convert back
-- to the Buckets_Allocation type, and do the free on that.
Free (Buckets_Allocation (Buckets));
end Free_Buckets;
--------------------- ---------------------
-- Free_Hash_Table -- -- Free_Hash_Table --
--------------------- ---------------------
...@@ -265,7 +282,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -265,7 +282,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
end loop; end loop;
end loop; end loop;
Free (Buckets); Free_Buckets (Buckets);
end Free_Hash_Table; end Free_Hash_Table;
------------------- -------------------
...@@ -273,8 +290,8 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -273,8 +290,8 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
------------------- -------------------
function Generic_Equal function Generic_Equal
(L, R : Hash_Table_Type) return Boolean is (L, R : Hash_Table_Type) return Boolean
is
L_Index : Hash_Type; L_Index : Hash_Type;
L_Node : Node_Access; L_Node : Node_Access;
...@@ -386,9 +403,9 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -386,9 +403,9 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
if HT.Buckets = null if HT.Buckets = null
or else HT.Buckets'Length < N or else HT.Buckets'Length < N
then then
Free (HT.Buckets); Free_Buckets (HT.Buckets);
NN := Prime_Numbers.To_Prime (N); NN := Prime_Numbers.To_Prime (N);
HT.Buckets := new Buckets_Type (0 .. NN - 1); HT.Buckets := New_Buckets (Length => NN);
end if; end if;
for J in 1 .. N loop for J in 1 .. N loop
...@@ -481,6 +498,20 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -481,6 +498,20 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
Source.Length := 0; Source.Length := 0;
end Move; end Move;
-----------------
-- New_Buckets --
-----------------
function New_Buckets (Length : Hash_Type) return Buckets_Access is
subtype Rng is Hash_Type range 0 .. Length - 1;
begin
-- Allocate in Buckets_Allocation'Storage_Pool, then convert to
-- Buckets_Access.
return Buckets_Access (Buckets_Allocation'(new Buckets_Type (Rng)));
end New_Buckets;
---------- ----------
-- Next -- -- Next --
---------- ----------
...@@ -521,7 +552,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -521,7 +552,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
if HT.Buckets = null then if HT.Buckets = null then
if N > 0 then if N > 0 then
NN := Prime_Numbers.To_Prime (N); NN := Prime_Numbers.To_Prime (N);
HT.Buckets := new Buckets_Type (0 .. NN - 1); HT.Buckets := New_Buckets (Length => NN);
end if; end if;
return; return;
...@@ -536,7 +567,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -536,7 +567,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
-- length that corresponds to a prime number.) -- length that corresponds to a prime number.)
if N = 0 then if N = 0 then
Free (HT.Buckets); Free_Buckets (HT.Buckets);
return; return;
end if; end if;
...@@ -553,8 +584,8 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -553,8 +584,8 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
declare declare
X : Buckets_Access := HT.Buckets; X : Buckets_Access := HT.Buckets;
begin begin
HT.Buckets := new Buckets_Type (0 .. NN - 1); HT.Buckets := New_Buckets (Length => NN);
Free (X); Free_Buckets (X);
end; end;
return; return;
...@@ -595,7 +626,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -595,7 +626,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
end if; end if;
Rehash : declare Rehash : declare
Dst_Buckets : Buckets_Access := new Buckets_Type (0 .. NN - 1); Dst_Buckets : Buckets_Access := New_Buckets (Length => NN);
Src_Buckets : Buckets_Access := HT.Buckets; Src_Buckets : Buckets_Access := HT.Buckets;
L : Count_Type renames HT.Length; L : Count_Type renames HT.Length;
...@@ -656,7 +687,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -656,7 +687,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
end; end;
end loop; end loop;
Free (Dst_Buckets); Free_Buckets (Dst_Buckets);
raise Program_Error with raise Program_Error with
"hash function raised exception during rehash"; "hash function raised exception during rehash";
end; end;
...@@ -667,7 +698,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -667,7 +698,7 @@ package body Ada.Containers.Hash_Tables.Generic_Operations is
HT.Buckets := Dst_Buckets; HT.Buckets := Dst_Buckets;
HT.Length := LL; HT.Length := LL;
Free (Src_Buckets); Free_Buckets (Src_Buckets);
end Rehash; end Rehash;
end Reserve_Capacity; end Reserve_Capacity;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -163,4 +163,15 @@ package Ada.Containers.Hash_Tables.Generic_Operations is ...@@ -163,4 +163,15 @@ package Ada.Containers.Hash_Tables.Generic_Operations is
-- first clears hash table HT, then populates the hash table by calling -- first clears hash table HT, then populates the hash table by calling
-- New_Node for each item in Stream. -- New_Node for each item in Stream.
function New_Buckets (Length : Hash_Type) return Buckets_Access;
pragma Inline (New_Buckets);
-- Allocate a new Buckets_Type array with bounds 0..Length-1.
procedure Free_Buckets (Buckets : in out Buckets_Access);
pragma Inline (Free_Buckets);
-- Unchecked_Deallocate Buckets.
-- Note: New_Buckets and Free_Buckets are needed because Buckets_Access has
-- an empty pool.
end Ada.Containers.Hash_Tables.Generic_Operations; end Ada.Containers.Hash_Tables.Generic_Operations;
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -45,6 +45,7 @@ generic ...@@ -45,6 +45,7 @@ generic
package Ada.Containers.Indefinite_Doubly_Linked_Lists is package Ada.Containers.Indefinite_Doubly_Linked_Lists is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
type List is tagged private; type List is tagged private;
pragma Preelaborable_Initialization (List); pragma Preelaborable_Initialization (List);
...@@ -195,6 +196,10 @@ package Ada.Containers.Indefinite_Doubly_Linked_Lists is ...@@ -195,6 +196,10 @@ package Ada.Containers.Indefinite_Doubly_Linked_Lists is
end Generic_Sorting; end Generic_Sorting;
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -48,6 +48,7 @@ generic ...@@ -48,6 +48,7 @@ generic
package Ada.Containers.Indefinite_Hashed_Maps is package Ada.Containers.Indefinite_Hashed_Maps is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
type Map is tagged private; type Map is tagged private;
pragma Preelaborable_Initialization (Map); pragma Preelaborable_Initialization (Map);
...@@ -159,6 +160,7 @@ private ...@@ -159,6 +160,7 @@ private
pragma Inline (Reserve_Capacity); pragma Inline (Reserve_Capacity);
pragma Inline (Has_Element); pragma Inline (Has_Element);
pragma Inline (Equivalent_Keys); pragma Inline (Equivalent_Keys);
pragma Inline (Next);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -340,7 +340,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -340,7 +340,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
declare declare
Size : constant Hash_Type := Prime_Numbers.To_Prime (Left.Length); Size : constant Hash_Type := Prime_Numbers.To_Prime (Left.Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Length := 0; Length := 0;
...@@ -817,7 +817,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -817,7 +817,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
declare declare
Size : constant Hash_Type := Prime_Numbers.To_Prime (Length); Size : constant Hash_Type := Prime_Numbers.To_Prime (Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Length := 0; Length := 0;
...@@ -1372,7 +1372,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -1372,7 +1372,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Size : constant Hash_Type := Size : constant Hash_Type :=
Prime_Numbers.To_Prime (Left.Length + Right.Length); Prime_Numbers.To_Prime (Left.Length + Right.Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Length := 0; Length := 0;
...@@ -1574,7 +1574,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is ...@@ -1574,7 +1574,7 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
Size : constant Hash_Type := Size : constant Hash_Type :=
Prime_Numbers.To_Prime (Left.Length + Right.Length); Prime_Numbers.To_Prime (Left.Length + Right.Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Iterate_Left : declare Iterate_Left : declare
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -50,6 +50,7 @@ generic ...@@ -50,6 +50,7 @@ generic
package Ada.Containers.Indefinite_Hashed_Sets is package Ada.Containers.Indefinite_Hashed_Sets is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
type Set is tagged private; type Set is tagged private;
pragma Preelaborable_Initialization (Set); pragma Preelaborable_Initialization (Set);
...@@ -204,6 +205,9 @@ package Ada.Containers.Indefinite_Hashed_Sets is ...@@ -204,6 +205,9 @@ package Ada.Containers.Indefinite_Hashed_Sets is
end Generic_Keys; end Generic_Keys;
private private
pragma Inline (Next);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -47,6 +47,7 @@ generic ...@@ -47,6 +47,7 @@ generic
package Ada.Containers.Indefinite_Ordered_Maps is package Ada.Containers.Indefinite_Ordered_Maps is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
function Equivalent_Keys (Left, Right : Key_Type) return Boolean; function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
...@@ -176,6 +177,9 @@ package Ada.Containers.Indefinite_Ordered_Maps is ...@@ -176,6 +177,9 @@ package Ada.Containers.Indefinite_Ordered_Maps is
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -46,6 +46,7 @@ generic ...@@ -46,6 +46,7 @@ generic
package Ada.Containers.Indefinite_Ordered_Multisets is package Ada.Containers.Indefinite_Ordered_Multisets is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
function Equivalent_Elements (Left, Right : Element_Type) return Boolean; function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
...@@ -238,6 +239,9 @@ package Ada.Containers.Indefinite_Ordered_Multisets is ...@@ -238,6 +239,9 @@ package Ada.Containers.Indefinite_Ordered_Multisets is
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -46,6 +46,7 @@ generic ...@@ -46,6 +46,7 @@ generic
package Ada.Containers.Indefinite_Ordered_Sets is package Ada.Containers.Indefinite_Ordered_Sets is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
function Equivalent_Elements (Left, Right : Element_Type) return Boolean; function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
...@@ -242,6 +243,9 @@ package Ada.Containers.Indefinite_Ordered_Sets is ...@@ -242,6 +243,9 @@ package Ada.Containers.Indefinite_Ordered_Sets is
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -47,6 +47,7 @@ generic ...@@ -47,6 +47,7 @@ generic
package Ada.Containers.Hashed_Maps is package Ada.Containers.Hashed_Maps is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
type Map is tagged private; type Map is tagged private;
pragma Preelaborable_Initialization (Map); pragma Preelaborable_Initialization (Map);
...@@ -164,6 +165,7 @@ private ...@@ -164,6 +165,7 @@ private
pragma Inline (Reserve_Capacity); pragma Inline (Reserve_Capacity);
pragma Inline (Has_Element); pragma Inline (Has_Element);
pragma Inline (Equivalent_Keys); pragma Inline (Equivalent_Keys);
pragma Inline (Next);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -327,7 +327,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -327,7 +327,7 @@ package body Ada.Containers.Hashed_Sets is
declare declare
Size : constant Hash_Type := Prime_Numbers.To_Prime (Left.Length); Size : constant Hash_Type := Prime_Numbers.To_Prime (Left.Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Length := 0; Length := 0;
...@@ -753,7 +753,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -753,7 +753,7 @@ package body Ada.Containers.Hashed_Sets is
declare declare
Size : constant Hash_Type := Prime_Numbers.To_Prime (Length); Size : constant Hash_Type := Prime_Numbers.To_Prime (Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Length := 0; Length := 0;
...@@ -1248,7 +1248,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -1248,7 +1248,7 @@ package body Ada.Containers.Hashed_Sets is
Size : constant Hash_Type := Size : constant Hash_Type :=
Prime_Numbers.To_Prime (Left.Length + Right.Length); Prime_Numbers.To_Prime (Left.Length + Right.Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Length := 0; Length := 0;
...@@ -1426,7 +1426,7 @@ package body Ada.Containers.Hashed_Sets is ...@@ -1426,7 +1426,7 @@ package body Ada.Containers.Hashed_Sets is
Size : constant Hash_Type := Size : constant Hash_Type :=
Prime_Numbers.To_Prime (Left.Length + Right.Length); Prime_Numbers.To_Prime (Left.Length + Right.Length);
begin begin
Buckets := new Buckets_Type (0 .. Size - 1); Buckets := HT_Ops.New_Buckets (Length => Size);
end; end;
Iterate_Left : declare Iterate_Left : declare
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -49,6 +49,7 @@ generic ...@@ -49,6 +49,7 @@ generic
package Ada.Containers.Hashed_Sets is package Ada.Containers.Hashed_Sets is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
type Set is tagged private; type Set is tagged private;
pragma Preelaborable_Initialization (Set); pragma Preelaborable_Initialization (Set);
...@@ -203,6 +204,9 @@ package Ada.Containers.Hashed_Sets is ...@@ -203,6 +204,9 @@ package Ada.Containers.Hashed_Sets is
end Generic_Keys; end Generic_Keys;
private private
pragma Inline (Next);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
-- containers. -- containers.
package Ada.Containers.Hash_Tables is package Ada.Containers.Hash_Tables is
pragma Preelaborate; pragma Pure; -- so this can be imported by Remote_Types packages
generic generic
type Node_Type (<>) is limited private; type Node_Type (<>) is limited private;
...@@ -43,7 +43,8 @@ package Ada.Containers.Hash_Tables is ...@@ -43,7 +43,8 @@ package Ada.Containers.Hash_Tables is
package Generic_Hash_Table_Types is package Generic_Hash_Table_Types is
type Buckets_Type is array (Hash_Type range <>) of Node_Access; type Buckets_Type is array (Hash_Type range <>) of Node_Access;
type Buckets_Access is access Buckets_Type; type Buckets_Access is access all Buckets_Type;
for Buckets_Access'Storage_Size use 0; -- so this package can be Pure
type Hash_Table_Type is tagged record type Hash_Table_Type is tagged record
Buckets : Buckets_Access; Buckets : Buckets_Access;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
-- This unit was originally developed by Matthew J Heaney. -- -- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Finalization; private with Ada.Finalization;
with Ada.Streams; private with Ada.Streams;
generic generic
type Index_Type is range <>; type Index_Type is range <>;
...@@ -44,6 +44,7 @@ generic ...@@ -44,6 +44,7 @@ generic
package Ada.Containers.Indefinite_Vectors is package Ada.Containers.Indefinite_Vectors is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
subtype Extended_Index is Index_Type'Base subtype Extended_Index is Index_Type'Base
range Index_Type'First - 1 .. range Index_Type'First - 1 ..
...@@ -301,12 +302,17 @@ private ...@@ -301,12 +302,17 @@ private
pragma Inline (Update_Element); pragma Inline (Update_Element);
pragma Inline (Replace_Element); pragma Inline (Replace_Element);
pragma Inline (Contains); pragma Inline (Contains);
pragma Inline (Next);
pragma Inline (Previous);
type Element_Access is access Element_Type; type Element_Access is access Element_Type;
type Elements_Type is array (Index_Type range <>) of Element_Access; type Elements_Array is array (Index_Type range <>) of Element_Access;
function "=" (L, R : Elements_Array) return Boolean is abstract;
function "=" (L, R : Elements_Type) return Boolean is abstract; type Elements_Type (Last : Index_Type) is limited record
EA : Elements_Array (Index_Type'First .. Last);
end record;
type Elements_Access is access Elements_Type; type Elements_Access is access Elements_Type;
...@@ -319,8 +325,10 @@ private ...@@ -319,8 +325,10 @@ private
Lock : Natural := 0; Lock : Natural := 0;
end record; end record;
overriding
procedure Adjust (Container : in out Vector); procedure Adjust (Container : in out Vector);
overriding
procedure Finalize (Container : in out Vector); procedure Finalize (Container : in out Vector);
use Ada.Streams; use Ada.Streams;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -32,8 +32,9 @@ ...@@ -32,8 +32,9 @@
-- -- -- --
-- This unit was originally developed by Matthew J Heaney. -- -- This unit was originally developed by Matthew J Heaney. --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Finalization;
with Ada.Streams; private with Ada.Finalization;
private with Ada.Streams;
generic generic
type Index_Type is range <>; type Index_Type is range <>;
...@@ -43,6 +44,7 @@ generic ...@@ -43,6 +44,7 @@ generic
package Ada.Containers.Vectors is package Ada.Containers.Vectors is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
subtype Extended_Index is Index_Type'Base subtype Extended_Index is Index_Type'Base
range Index_Type'First - 1 .. range Index_Type'First - 1 ..
...@@ -311,10 +313,15 @@ private ...@@ -311,10 +313,15 @@ private
pragma Inline (Update_Element); pragma Inline (Update_Element);
pragma Inline (Replace_Element); pragma Inline (Replace_Element);
pragma Inline (Contains); pragma Inline (Contains);
pragma Inline (Next);
pragma Inline (Previous);
type Elements_Type is array (Index_Type range <>) of Element_Type; type Elements_Array is array (Index_Type range <>) of Element_Type;
function "=" (L, R : Elements_Array) return Boolean is abstract;
function "=" (L, R : Elements_Type) return Boolean is abstract; type Elements_Type (Last : Index_Type) is limited record
EA : Elements_Array (Index_Type'First .. Last);
end record;
type Elements_Access is access Elements_Type; type Elements_Access is access Elements_Type;
...@@ -327,8 +334,10 @@ private ...@@ -327,8 +334,10 @@ private
Lock : Natural := 0; Lock : Natural := 0;
end record; end record;
overriding
procedure Adjust (Container : in out Vector); procedure Adjust (Container : in out Vector);
overriding
procedure Finalize (Container : in out Vector); procedure Finalize (Container : in out Vector);
use Ada.Streams; use Ada.Streams;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -46,6 +46,7 @@ generic ...@@ -46,6 +46,7 @@ generic
package Ada.Containers.Ordered_Maps is package Ada.Containers.Ordered_Maps is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
function Equivalent_Keys (Left, Right : Key_Type) return Boolean; function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
...@@ -181,6 +182,9 @@ package Ada.Containers.Ordered_Maps is ...@@ -181,6 +182,9 @@ package Ada.Containers.Ordered_Maps is
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -45,6 +45,7 @@ generic ...@@ -45,6 +45,7 @@ generic
package Ada.Containers.Ordered_Multisets is package Ada.Containers.Ordered_Multisets is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
function Equivalent_Elements (Left, Right : Element_Type) return Boolean; function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
...@@ -245,6 +246,9 @@ package Ada.Containers.Ordered_Multisets is ...@@ -245,6 +246,9 @@ package Ada.Containers.Ordered_Multisets is
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2007, Free Software Foundation, Inc. --
-- -- -- --
-- This specification is derived from the Ada Reference Manual for use with -- -- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow -- -- GNAT. The copyright notice above, and the license provisions that follow --
...@@ -45,6 +45,7 @@ generic ...@@ -45,6 +45,7 @@ generic
package Ada.Containers.Ordered_Sets is package Ada.Containers.Ordered_Sets is
pragma Preelaborate; pragma Preelaborate;
pragma Remote_Types;
function Equivalent_Elements (Left, Right : Element_Type) return Boolean; function Equivalent_Elements (Left, Right : Element_Type) return Boolean;
...@@ -233,6 +234,9 @@ package Ada.Containers.Ordered_Sets is ...@@ -233,6 +234,9 @@ package Ada.Containers.Ordered_Sets is
private private
pragma Inline (Next);
pragma Inline (Previous);
type Node_Type; type Node_Type;
type Node_Access is access Node_Type; type Node_Access is access Node_Type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment