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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,eb896440a3af23cf X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s02.POSTED!53ab2750!not-for-mail From: "Jeff C r e e.m" Newsgroups: comp.lang.ada References: Subject: Re: large arrays X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.147.74.171 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s02 1100044496 24.147.74.171 (Tue, 09 Nov 2004 23:54:56 GMT) NNTP-Posting-Date: Tue, 09 Nov 2004 23:54:56 GMT Organization: Comcast Online Date: Tue, 09 Nov 2004 23:55:00 GMT Xref: g2news1.google.com comp.lang.ada:6095 Date: 2004-11-09T23:55:00+00:00 List-Id: "Joel Lepinoux" wrote in message news:mailman.87.1100029172.10401.comp.lang.ada@ada-france.org... > Hello, > for the first time I need to declare a large array (>1Go), here are my > structures: > > > type Site is array (1..3) of Short_Short_Integer; -- size=24 bits > type Site_Matrix is array (Integer range <>, Integer range <>) of Site; > > -- maximum allowed size, about 245Mo > My_Array: Site_Matrix(1..1_132_000,1..72); > > > If I increase the first upper bound (1_132_000) I get a warning from gnat > (3.15p) comfirmed at runtime: STORAGE_ERROR: object too large > > This means that "My_Array" is too large but of course I can declare a > second array of same dimensions and so one, i.e. it is not a problem of > total space (2Go available) neither of bound out of range, etc. > > I would be glad to understand the origin of this limit and it would be > great if somebody could tell me how to extend it. > Thanks in advance > Joel > > You dont say but I assume you are using GNAT? >From the GNAT RM (6.2) The largest Size value permitted in GNAT is 2**31-1. Since this is a Size in bits, this corresponds to an object of size 256 megabytes (minus one). This limitation is true on all targets. The reason for this limitation is that it improves the quality of the code in many cases if it is known that a Size value can be accommodated in an object of type Integer.