comp.lang.ada
 help / color / mirror / Atom feed
From: "Markus Schöpflin" <no.spam@spam.spam>
Subject: Re: How do typical Ada calling conventions work ?
Date: Fri, 21 Aug 2015 12:41:01 +0200
Date: 2015-08-21T12:41:01+02:00	[thread overview]
Message-ID: <mr6v7s$ouc$1@speranza.aioe.org> (raw)
In-Reply-To: 2a592336-034f-4483-9aed-b5a1d997f902@googlegroups.com

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.
--->%---

  reply	other threads:[~2015-08-21 10:41 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 [this message]
2015-08-21 12:47   ` Niklas Holsti
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