comp.lang.ada
 help / color / mirror / Atom feed
* Changing SS_Pool
@ 2016-11-16 22:11 Lucretia
  2016-11-16 22:18 ` Lucretia
  0 siblings, 1 reply; 4+ messages in thread
From: Lucretia @ 2016-11-16 22:11 UTC (permalink / raw)


Hi,

Is it possible to make SS_Pool be an array of storage_elements instead of just an integer? Seems pointless creating a separate array and having that random integer just because the compiler expects it.

Thanks,
Luke.

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

* Re: Changing SS_Pool
  2016-11-16 22:11 Changing SS_Pool Lucretia
@ 2016-11-16 22:18 ` Lucretia
  2016-11-17  9:20   ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Lucretia @ 2016-11-16 22:18 UTC (permalink / raw)


On Wednesday, 16 November 2016 22:11:49 UTC, Lucretia  wrote:
> Hi,
> 
> Is it possible to make SS_Pool be an array of storage_elements instead of just an integer? Seems pointless creating a separate array and having that random integer just because the compiler expects it.

It seems to work, but whether it's legal or not, I'm not so sure.


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

* Re: Changing SS_Pool
  2016-11-16 22:18 ` Lucretia
@ 2016-11-17  9:20   ` Simon Wright
  2016-11-17 14:03     ` Lucretia
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2016-11-17  9:20 UTC (permalink / raw)


Lucretia <laguest9000@googlemail.com> writes:

> On Wednesday, 16 November 2016 22:11:49 UTC, Lucretia  wrote:
>> Hi,
>> 
>> Is it possible to make SS_Pool be an array of storage_elements
>> instead of just an integer? Seems pointless creating a separate
>> array and having that random integer just because the compiler
>> expects it.
>
> It seems to work, but whether it's legal or not, I'm not so sure.

The declaration is

private
   SS_Pool : Integer;
   --  Unused entity that is just present to ease the sharing of the pool
   --  mechanism for specific allocation/deallocation in the compiler

which I think means either that in a full RTS the ompiler has to do
stuff which it doesn't in a restricted RTS, or that it's a fossil from
some previous design.

I just looked into (a) a build using GNAT GPL 2016, (b) a build using
one of my cortex-gnat-rts runtimes. In (a), ss_pool occupies 4 bytes, in
(b) it's in a discarded input section. Both RTSs are compiled with
-ffunction-sections -fdata-sections, the difference is that in (b) my
project GPR explicity has those two switches in package Builder, and
-Wl,-gc-sections in package Linker. I wonder whether they should be in
the RTS's runtime.xml, so as to be used everywhere? Will ask AdaCore.


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

* Re: Changing SS_Pool
  2016-11-17  9:20   ` Simon Wright
@ 2016-11-17 14:03     ` Lucretia
  0 siblings, 0 replies; 4+ messages in thread
From: Lucretia @ 2016-11-17 14:03 UTC (permalink / raw)


On Thursday, 17 November 2016 09:20:56 UTC, Simon Wright  wrote:
> Lucretia <me> writes:
> 
> > On Wednesday, 16 November 2016 22:11:49 UTC, Lucretia  wrote:
> >> Hi,
> >> 
> >> Is it possible to make SS_Pool be an array of storage_elements
> >> instead of just an integer? Seems pointless creating a separate
> >> array and having that random integer just because the compiler
> >> expects it.
> >
> > It seems to work, but whether it's legal or not, I'm not so sure.
> 
> The declaration is
> 
> private
>    SS_Pool : Integer;
>    --  Unused entity that is just present to ease the sharing of the pool
>    --  mechanism for specific allocation/deallocation in the compiler
> 
> which I think means either that in a full RTS the ompiler has to do
> stuff which it doesn't in a restricted RTS, or that it's a fossil from
> some previous design.
> 
> I just looked into (a) a build using GNAT GPL 2016, (b) a build using
> one of my cortex-gnat-rts runtimes. In (a), ss_pool occupies 4 bytes, in
> (b) it's in a discarded input section. Both RTSs are compiled with
> -ffunction-sections -fdata-sections, the difference is that in (b) my
> project GPR explicity has those two switches in package Builder, and
> -Wl,-gc-sections in package Linker. I wonder whether they should be in
> the RTS's runtime.xml, so as to be used everywhere? Will ask AdaCore.

It doesn't seem to be having an adverse effect being an array.

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

end of thread, other threads:[~2016-11-17 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 22:11 Changing SS_Pool Lucretia
2016-11-16 22:18 ` Lucretia
2016-11-17  9:20   ` Simon Wright
2016-11-17 14:03     ` Lucretia

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