comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: How do typical Ada calling conventions work ?
Date: Fri, 21 Aug 2015 15:47:04 +0300
Date: 2015-08-21T15:47:04+03:00	[thread overview]
Message-ID: <d3oku8Fj86tU1@mid.individual.net> (raw)
In-Reply-To: <mr6v7s$ouc$1@speranza.aioe.org>

On 15-08-21 13:41 , Markus Schöpflin wrote:
> Am 21.08.2015 um 10:37 schrieb Hadrien Grasland:
>
>> Does someone know how typical Ada implementations manage to cope with
>> this, and if it varies a lot from one implementation to another ?
>
> GNAT allocates such objects on the secondary stack. Quote from the user
> guide:
>
> ---%<---
> `-Dnn[k|m]'
> This switch can be used to change the default secondary stack size value
> to a specified size nn, which is expressed in bytes by default, or in
> kilobytes when suffixed with k or in megabytes when suffixed with m.
>
> The secondary stack is used to deal with functions that return a
> variable sized result, for example a function returning an unconstrained
> String. There are two ways in which this secondary stack is allocated.
>
> For most targets, the secondary stack is growing on demand and is
> allocated as a chain of blocks in the heap. The -D option is not very
> relevant. It only give some control over the size of the allocated
> blocks (whose size is the minimum of the default secondary stack size
> value, and the actual size needed for the current allocation request).
>
> For certain targets, notably VxWorks 653, the secondary stack is
> allocated by carving off a fixed ratio chunk of the primary task stack.
> The -D option is used to define the size of the environment task's
> secondary stack.
> --->%---

I stumbled across an interesting, old discussion about GNAT's approach 
(it seems a secondary stack was not the initial choice) with references 
to some other compilers:

http://computer-programming-forum.com/44-ada/2227f74c82f45451.htm


-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


  reply	other threads:[~2015-08-21 12:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21  8:37 How do typical Ada calling conventions work ? Hadrien Grasland
2015-08-21 10:41 ` Markus Schöpflin
2015-08-21 12:47   ` Niklas Holsti [this message]
2015-08-22  8:31     ` Hadrien Grasland
2015-08-24 22:03       ` Randy Brukardt
2015-08-25  5:32         ` Per Sandberg
2015-08-25  7:05           ` AdaMagica
2015-08-25  7:28             ` AdaMagica
2015-08-31 23:01           ` Randy Brukardt
2015-08-25 18:38 ` gautier_niouzes
2015-08-26 15:53   ` Hadrien Grasland
replies disabled

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