aboutsummaryrefslogtreecommitdiffstats
path: root/src/dyn_tables.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-13 06:07:50 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-13 06:07:50 +0100
commit796d5a09cb31f1dbcdb021febfac8bc5fd112c21 (patch)
treefbda9ffe34fdc1b7c0aaaea4814a99a569228b51 /src/dyn_tables.ads
parent5c8fc25f3e27190f4ff8ce943e2d33375f2b9512 (diff)
downloadghdl-796d5a09cb31f1dbcdb021febfac8bc5fd112c21.tar.gz
ghdl-796d5a09cb31f1dbcdb021febfac8bc5fd112c21.tar.bz2
ghdl-796d5a09cb31f1dbcdb021febfac8bc5fd112c21.zip
tables: handle larger tables (use unsigned type instead of natural).
Diffstat (limited to 'src/dyn_tables.ads')
-rw-r--r--src/dyn_tables.ads9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dyn_tables.ads b/src/dyn_tables.ads
index 600e2bf85..f1cffac84 100644
--- a/src/dyn_tables.ads
+++ b/src/dyn_tables.ads
@@ -71,6 +71,9 @@ package Dyn_Tables is
function Last (T : Instance) return Table_Index_Type;
pragma Inline (Last);
+ -- Return the index of the next bound after last.
+ function Next (T : Instance) return Table_Index_Type;
+
-- Deallocate all the memory. Makes the array unusable until the next
-- call to Init.
procedure Free (T : in out Instance);
@@ -95,11 +98,13 @@ package Dyn_Tables is
procedure Allocate (T : in out Instance; Num : Natural := 1);
private
+ type Unsigned is mod 2**32;
+
type Instance_Private is record
-- Number of allocated elements in the table.
- Length : Natural := 0;
+ Length : Unsigned := 0;
-- Number of used elements in the table.
- Last_Pos : Natural := 0;
+ Last_Pos : Unsigned := 0;
end record;
end Dyn_Tables;