From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: 'Storage_Size in Ada95
Date: Mon, 21 May 2001 05:36:42 -0500
Date: 2001-05-21T05:36:42-05:00 [thread overview]
Message-ID: <2d6O6.1310$ce.2870383@newsrump.sjc.telocity.net> (raw)
In-Reply-To: 3b08e4c9$1@pull.gecm.com
From RM95, Annex L:
35 pragma Storage_Size(expression); � See 13.3.
And from RM95 3.13:
59 For a prefix T that denotes a task object (after any implicit
dereference):
60 T�Storage_Size Denotes the number of storage elements reserved for
the task. The value of this attribute is of the type universal_integer. The
Storage_Size includes the size of the task�s stack, if any. The language
does not specify whether or not it includes other storage associated with
the task (such as the �task control block� used by some implementations.)
If a pragma Storage_Size is given, the value of the Storage_Size attribute
is at least the value specified in the pragma.
61 A pragma Storage_Size specifies the amount of storage to be reserved
for the execution of a task.
Syntax
62 The form of a pragma Storage_Size is as follows:
63 pragma Storage_Size(expression);
64 A pragma Storage_Size is allowed only immediately within a
task_definition.
Name Resolution Rules
65 The expression of a pragma Storage_Size is expected to be of any
integer type.
Dynamic Semantics
66 A pragma Storage_Size is elaborated when an object of the type
defined by the immediately enclosing task_definition is created. For
the elaboration of a pragma Storage_Size, the expression is evaluated;
the Storage_Size attribute of the newly created task object is at least
the value of the expression.
67 At the point of task object creation, or upon task activation,
Storage_Error is raised if there is insufficient free storage to
accommodate the requested Storage_Size.
"Martin Dowie" <martin.dowie@nospam.baesystems.com> wrote in message
news:3b08e4c9$1@pull.gecm.com...
> Can someone give me a quick example of the Ada95 way of
> allocating storage to for task type? (I've left my Barnes
> book at home, doh!)
>
> e.g the equivilant of Ada83:
>
> package A is
> ...
> task type B is
> entry C;
> end B;
> for B'Storage_Size use (Some_Value);
> ...
> end A;
>
> Thanks in advance...
>
>
>
next prev parent reply other threads:[~2001-05-21 10:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-21 9:59 'Storage_Size in Ada95 Martin Dowie
2001-05-21 10:36 ` David C. Hoos, Sr. [this message]
2001-05-21 12:00 ` Martin Dowie
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox