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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:455c:: with SMTP id y89-v6mr331410ita.0.1527668083416; Wed, 30 May 2018 01:14:43 -0700 (PDT) X-Received: by 2002:a9d:5325:: with SMTP id g37-v6mr81632oth.7.1527668083226; Wed, 30 May 2018 01:14:43 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!85.12.16.70.MISMATCH!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u74-v6no7475070itb.0!news-out.google.com!f20-v6ni6898itd.0!nntp.google.com!u74-v6no7475068itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 30 May 2018 01:14:42 -0700 (PDT) In-Reply-To: <13ec49fb-8c1a-42a4-b1a2-3984d0e159f7@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=136.163.203.5; posting-account=HFCrOQoAAABZD_f-UUbYHm3lJDIrh-UX NNTP-Posting-Host: 136.163.203.5 References: <13ec49fb-8c1a-42a4-b1a2-3984d0e159f7@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <60552a08-2b32-4e76-bfd8-8d6341f57c8d@googlegroups.com> Subject: Re: Memory pools From: joakimds@kth.se Injection-Date: Wed, 30 May 2018 08:14:43 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 4262 X-Received-Body-CRC: 3960177817 Xref: reader02.eternal-september.org comp.lang.ada:52780 Date: 2018-05-30T01:14:42-07:00 List-Id: > I apologize if this is a dumb question, but: >=20 > I've read that Ada uses memory pools for each type. When I read this, I t= hink it means, for instance, Ada sets up something like an array of 10000 e= lements for each type, and when the user asks to allocate a new object of s= uch-and-such type, the run-time system hands that to you. >=20 > Is that the idea, or do they mean something else? I agree the descriptions can be fuzzy. The way I understand it is that when= ever one defines an access type a memory pool is associated with it. If one= doesn't specify a memory pool, the default is to use the Global memory poo= l which on ordinary desktop computers means the heap. When it comes to memory pools I've used Deepend. Maybe I can find the time = to write more about this tonight when I come home from work but Brad Moore = wrote the following in February 2017: Its been a while since a new release of Deepend has been announced, the las= t announced version being version 3.4, though there have been updates since= then.=20 Now that 3.9 has been posted, seems like a good time to mention the availab= ility of new features and fixes.=20 Deepend is a set of storage pools for Ada 95, Ada 2005, and Ada 2012 that= =20 includes subpool capabilities. Groups of memory allocations from a storage= =20 pool can be assigned to specific subpools where groups of objects can be d= eallocated as a group by deallocating the subpool, rather than by individua= l deallocations of objects.=20 Each subpool is "owned" by a specific task in Ada, allowing allocations and= =20 deallocations to be efficient, as well as being safer and less error prone.= =20 Since version 3.4, the most notable changes are;=20 - Ada 2012 subpools were not working in version 3.4, but now work properly= =20 with the Ada 2012 subpool syntax.=20 - It is now possible to set task ownership of the storage pool itself, as= =20 well as subpools.=20 - Portability changes made to integrate with PTC's ObjectAda 64bit compiler= =20 for Ada 2005 and Ada 95=20 - Portability changes made to integrate with RR Software's Janus Ada=20 compiler for Ada 95=20 - Memory allocations returned by the generic allocators were not=20 initializing memory. This is important for types that have discriminants= =20 or tags. Now memory is initialised which is consistent with behaviour whe= n=20 one uses Ada's "new" keyword syntax to provide the allocations.=20 - The generic allocator routines now support allocating unconstrained types= ,=20 such as strings.=20 There are 4 different storage pools to choose from;=20 - Unbounded storage pool with subpool support=20 - Bounded storage pool with subpool support=20 - Unbounded storage pool without subpool support=20 - Bounded storage pool without subpool support=20 Deepend source code can be found at;=20 https://sourceforge.net/projects/deepend/files/=20 Regards,=20 Brad Moore