comp.lang.ada
 help / color / mirror / Atom feed
From: "Vinzent Hoefler" <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de>
Subject: Re: Large arrays passed to arithmetic operators overflows GNAT stack
Date: Sat, 04 Dec 2010 10:19:47 +0100
Date: 2010-12-04T10:19:47+01:00	[thread overview]
Message-ID: <op.vm6mu9ojlzeukk@jellix.jlfencey.com> (raw)
In-Reply-To: da4fcb09-efa7-46d4-aece-e86b0dcf6674@v17g2000prc.googlegroups.com

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.



  reply	other threads:[~2010-12-04  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04  6:32 Large arrays passed to arithmetic operators overflows GNAT stack Jerry
2010-12-04  9:19 ` Vinzent Hoefler [this message]
2010-12-04 13:27 ` Jeffrey Creem
2010-12-04 14:17 ` Peter C. Chapin
2010-12-05  1:22   ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox