From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Task storage
Date: 1998/02/24
Date: 1998-02-24T00:00:00+00:00 [thread overview]
Message-ID: <mheaney-ya023680002402982026020001@news.ni.net> (raw)
In-Reply-To: 34F30CB0.CD9@obs-vlfr.fr
In article <34F30CB0.CD9@obs-vlfr.fr>, laval@obs-vlfr.fr wrote:
>My Ada 95 application, compiled with Gnat 3.10 under Windows 95,
>recursively allocates large tasks (about 1_000 instructions).
>Storage_Error is raised after only a few ten tasks are created, despite
>the 40 Mbytes available on my machine. I need about 12 Kbytes of stack
>per task. The default storage pool is obviously too small. I would like
>to set up a user defined pool object, according to the chapter 13.11 of
>the ALRM, but the examples given make not very clear how Allocate could
>be overridden to reserve 12 Kbytes each time "new" is executed. Where
>can I find some examples which could be adapted to solve my problem?
Why not use the Storage_Size pragma or Storage_Size attribute for the task
directly?
Using a storage pool would only control how the memory for the task
*object* gets allocated; it has nothing to say about the task itself.
I think the storage size attribute is what you want, ie
task type T is ...;
for T'Storage_Size use 12 * 1024;
You can also use pragma form
task type T (Size : Positive) is
pragma Storage_Size (Size);
entry E;
...
end T;
(I think that's it. I haven't actually tried it yet.)
next prev parent reply other threads:[~1998-02-24 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-24 0:00 Task storage Philippe Laval
1998-02-24 0:00 ` Mats Weber
1998-02-24 0:00 ` Matthew Heaney [this message]
1998-02-25 0:00 ` Jonas Nygren
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox