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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.67.3.34 with SMTP id bt2mr45247pad.41.1383274160386; Thu, 31 Oct 2013 19:49:20 -0700 (PDT) X-Received: by 10.182.61.51 with SMTP id m19mr5865obr.30.1383274160274; Thu, 31 Oct 2013 19:49:20 -0700 (PDT) Path: border1.nntp.dca.giganews.com!nntp.giganews.com!z6no1207613pbz.1!news-out.google.com!9ni3696qaf.0!nntp.google.com!o2no13176699qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Oct 2013 19:49:20 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=150.101.201.124; posting-account=pBdvJAoAAAAbTiQ-L1tpxD99i_UttsrJ NNTP-Posting-Host: 150.101.201.124 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: GNAT: Why does a large 'new' allocation blow the stack when an initialiser is present ? From: Rod Kay Injection-Date: Fri, 01 Nov 2013 02:49:20 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.dca.giganews.com comp.lang.ada:183768 Date: 2013-10-31T19:49:20-07:00 List-Id: Hi all, Is this a bug ? procedure bug_Test is type Integer_array is array (Integer range <>) of Integer; the_Array_1 : access Integer_array := new Integer_array (1 .. 10_000_000); -- Fine. the_Array_2 : access Integer_array := new Integer_array' (1 .. 10_000_000 => <>); -- Stack overflow. begin null; end; It seems that, with the initialiser, GNAT is creating the array on the stack before copying it to the final heap memory ?