comp.lang.ada
 help / color / mirror / Atom feed
* GNAT: Why does a large 'new' allocation blow the stack when an initialiser is present ?
@ 2013-11-01  2:49 Rod Kay
  2013-11-01  8:45 ` Simon Wright
  2013-11-01 10:19 ` sbelmont700
  0 siblings, 2 replies; 6+ messages in thread
From: Rod Kay @ 2013-11-01  2:49 UTC (permalink / raw)


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 ?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-01 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-01  2:49 GNAT: Why does a large 'new' allocation blow the stack when an initialiser is present ? Rod Kay
2013-11-01  8:45 ` Simon Wright
2013-11-01 11:23   ` Rod Kay
2013-11-01 15:04   ` Georg Bauhaus
2013-11-01 10:19 ` sbelmont700
2013-11-01 11:28   ` Rod Kay

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