comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Thick bindings to a C library and gnattest: suggestions?
Date: Tue, 2 Jul 2013 17:27:10 -0500
Date: 2013-07-02T17:27:10-05:00	[thread overview]
Message-ID: <kqvk3v$dnk$1@loke.gir.dk> (raw)
In-Reply-To: kqtn1d$2ua$1@speranza.aioe.org

<tmoran@acm.org> wrote in message news:kqtn1d$2ua$1@speranza.aioe.org...
...
>> Amen! I've been saying that for 30+ years; perhaps someday it will really 
>> be
>> true in commonly used compilers.
>>
>>                              Randy.
>  I notice that when I tried the OP's declare with the Janus Ada compiler
> it ran for up to a little over 800MB for the array, then above that it
> said:
> ** Unhandled STORAGE_ERROR
>   Heap Overflow
> On Line Number 16 In TRYBIG.DOIT
> Called from line number 27 In TRYBIG
> suggesting that the compiler was

Janus/Ada unfortunately doesn't do this consistently. This is a hard 
problem, because the compiler doesn't know how big the stack will be at 
runtime, and adding the level of indirection costs a bit of performance. So 
you could run into trouble if the program uses a bunch of medium-sized but 
statically-sized objects that collectively overflow the stack.

In the OP's program, however, all of the objects are dynamically-sized; in 
that case, Janus/Ada always uses a level of indirection and only uses the 
stack for very small objects, so one gets the automatic heap-based 
allocation (and deallocation) seen here.

                                                    Randy.






  reply	other threads:[~2013-07-02 22:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01  9:02 Thick bindings to a C library and gnattest: suggestions? ziotom78
2013-07-01  9:45 ` Dmitry A. Kazakov
2013-07-01 11:11   ` Maurizio Tomasi
2013-07-01 11:41     ` Simon Wright
2013-07-01 12:00       ` Maurizio Tomasi
2013-07-01 12:42         ` Dmitry A. Kazakov
2013-07-01 19:07           ` Simon Wright
2013-07-01 12:32     ` Dmitry A. Kazakov
2013-07-01 12:41       ` Maurizio Tomasi
2013-07-01 12:47       ` Simon Wright
2013-07-02  8:55     ` Georg Bauhaus
2013-07-02  8:33   ` Maurizio Tomasi
2013-07-02  8:58     ` Dmitry A. Kazakov
2013-07-02 16:58     ` Robert A Duff
2013-07-02 17:00     ` Jeffrey Carter
2013-07-01 17:16 ` Jeffrey Carter
2013-07-02  4:24   ` Randy Brukardt
2013-07-02  4:37     ` Shark8
2013-07-02  5:04     ` tmoran
2013-07-02 22:27       ` Randy Brukardt [this message]
2013-07-03 12:02   ` Jacob Sparre Andersen
2013-07-02  3:16 ` Jerry
2013-07-02  4:02   ` Shark8
replies disabled

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