comp.lang.ada
 help / color / mirror / Atom feed
* 'Storage_Size in Ada95
@ 2001-05-21  9:59 Martin Dowie
  2001-05-21 10:36 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Dowie @ 2001-05-21  9:59 UTC (permalink / raw)


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






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

* Re: 'Storage_Size in Ada95
  2001-05-21  9:59 'Storage_Size in Ada95 Martin Dowie
@ 2001-05-21 10:36 ` David C. Hoos, Sr.
  2001-05-21 12:00   ` Martin Dowie
  0 siblings, 1 reply; 3+ messages in thread
From: David C. Hoos, Sr. @ 2001-05-21 10:36 UTC (permalink / raw)


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




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

* Re: 'Storage_Size in Ada95
  2001-05-21 10:36 ` David C. Hoos, Sr.
@ 2001-05-21 12:00   ` Martin Dowie
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Dowie @ 2001-05-21 12:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

many thanks, if only my (hypertext) LRM had pointed back to 3.13... :-)

David C. Hoos, Sr. <david.c.hoos.sr@ada95.com> wrote in message
news:2d6O6.1310$ce.2870383@newsrump.sjc.telocity.net...
> 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.
>
[snip]





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

end of thread, other threads:[~2001-05-21 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-21  9:59 'Storage_Size in Ada95 Martin Dowie
2001-05-21 10:36 ` David C. Hoos, Sr.
2001-05-21 12:00   ` Martin Dowie

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