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.2 required=5.0 tests=BAYES_00,FROM_LOCAL_HEX, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7bdbcdc23dd9313d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Vinzent Hoefler" <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> Newsgroups: comp.lang.ada Subject: Re: Large arrays passed to arithmetic operators overflows GNAT stack Date: Sat, 04 Dec 2010 10:19:47 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net vbBd3hcqkxZ85EQ9VH2kxwyQk4r8Z+rv78DF3EQtHQCiVqu426 Cancel-Lock: sha1:s4/wluBNwrSGJrJ//miEtHu0GqM= User-Agent: Opera Mail/10.63 (Win32) Xref: g2news2.google.com comp.lang.ada:16767 Date: 2010-12-04T10:19:47+01:00 List-Id: Jerry wrote: > with > Ada.Numerics.Long_Real_Arrays; > use > Ada.Numerics.Long_Real_Arrays; > procedure array_test is > type Real_Vector_Access is access Real_Vector; > N : Integer := 1_048_130; [...] > begin > for i in t'range loop > t(i) := 1.0; > end loop; > t_Diff := t(1 .. N) - t(0 .. N - 1); > end array_test; It's probably not the operator call that crashes, but the creation of the temporary arrays t(...). Couple of days ago, I stumbled upon a similar problem with aggegrate assignments: -- Do array initialization in a loop. -- If it's done with an aggregate assignment, GNAT raises Storage_Error -- during elaboration. > Another fix would be to write operator procedures that specifically > take pointers as arguments; that would possibly be the only fix for > arrays that still overflow the stack when it is maxed out. This wouldn't help here, I suppose. Vinzent. -- Beaten by the odds since 1974.