From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b0e28886667436ea X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Task storage Date: 1998/02/24 Message-ID: #1/1 X-Deja-AN: 328396214 Content-Transfer-Encoding: 8bit References: <34F30CB0.CD9@obs-vlfr.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1998-02-24T00:00:00+00:00 List-Id: 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.)