From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f479f3331eef5353 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Peter Schildmann Newsgroups: comp.lang.ada Subject: Re: Size of Vector limited to 1024 MB of Heap Size Date: Tue, 24 Jun 2008 20:55:31 +0200 Message-ID: <6ccu94F3et2evU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: individual.net xg8sPAKwCHT9JfE+CO2eAAvEpE0/DtPkmAwhapfCD3gr5tiQAe Cancel-Lock: sha1:iKhkU5qn6wQzQGbpqiv3LDegqIw= User-Agent: IceDove 1.5.0.14eol (X11/20080509) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:846 Date: 2008-06-24T20:55:31+02:00 List-Id: Dennis Hoppe schrieb: > loop > Generic_Vector.Append (Evil_Vector, Integer'Last); > end loop; It's not a good idea to use the STORAGE_ERROR exception to terminate an endless loop. This should work: with Ada.Text_IO; with Ada.Containers; with Ada.Containers.Vectors; procedure Heap is package Cnt_IO is new Ada.Text_IO.Integer_IO (Ada.Containers.Count_Type); package Generic_Vector is new Ada.Containers.Vectors (Element_Type => Integer, Index_Type => Natural); Evil_Vector : Generic_Vector.Vector; Size : constant := Integer'Size / Standard'Storage_Unit; begin for N in 0 .. Natural'Last / Size loop Generic_Vector.Append (Evil_Vector, N); end loop; Cnt_IO.Put (Generic_Vector.Capacity (Evil_Vector)); end Heap; - Peter