comp.lang.ada
 help / color / mirror / Atom feed
From: joakimds@kth.se
Subject: Re: Memory pools
Date: Wed, 30 May 2018 01:14:42 -0700 (PDT)
Date: 2018-05-30T01:14:42-07:00	[thread overview]
Message-ID: <60552a08-2b32-4e76-bfd8-8d6341f57c8d@googlegroups.com> (raw)
In-Reply-To: <13ec49fb-8c1a-42a4-b1a2-3984d0e159f7@googlegroups.com>

> I apologize if this is a dumb question, but:
> 
> I've read that Ada uses memory pools for each type. When I read this, I think it means, for instance, Ada sets up something like an array of 10000 elements for each type, and when the user asks to allocate a new object of such-and-such type, the run-time system hands that to you.
> 
> Is that the idea, or do they mean something else?

I agree the descriptions can be fuzzy. The way I understand it is that whenever 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 pool 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 last announced version being version 3.4, though there have been updates since then. 

Now that 3.9 has been posted, seems like a good time to mention the availability of new features and fixes. 

Deepend is a set of storage pools for Ada 95, Ada 2005, and Ada 2012 that 
includes subpool capabilities. Groups of memory allocations from a storage 
pool can be assigned to specific subpools where groups of objects can be  deallocated as a group by deallocating the subpool, rather than by individual deallocations of objects. 

Each subpool is "owned" by a specific task in Ada, allowing allocations and 
deallocations to be efficient, as well as being safer and less error prone. 

Since version 3.4, the most notable changes are; 

- Ada 2012 subpools were not working in version 3.4, but now work properly 
  with the Ada 2012 subpool syntax. 
- It is now possible to set task ownership of the storage pool itself, as 
  well as subpools. 
- Portability changes made to integrate with PTC's ObjectAda 64bit compiler 
  for Ada 2005 and Ada 95 
- Portability changes made to integrate with RR Software's Janus Ada 
  compiler for Ada 95 
- Memory allocations returned by the generic allocators were not 
  initializing memory. This is important for types that have discriminants 
  or tags. Now memory is initialised which is consistent with behaviour when 
  one uses Ada's "new" keyword syntax to provide the allocations. 
- The generic allocator routines now support allocating unconstrained types, 
  such as strings. 

There are 4 different storage pools to choose from; 
   - Unbounded storage pool with subpool support 
   - Bounded storage pool with subpool support 
   - Unbounded storage pool without subpool support 
   - Bounded storage pool without subpool support 

Deepend source code can be found at; 

https://sourceforge.net/projects/deepend/files/ 

Regards, 

Brad Moore

  reply	other threads:[~2018-05-30  8:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 19:41 Memory pools John Perry
2018-05-30  8:14 ` joakimds [this message]
2018-05-31 19:15   ` gorgelo
2018-05-31 19:19 ` gorgelo
2018-05-31 19:28 ` gorgelo
2018-05-31 19:33 ` gorgelo
2018-05-31 21:03   ` Simon Wright
2018-05-31 22:56   ` Randy Brukardt
2018-06-01  5:57     ` gorgelo
2018-06-04 21:14 ` John Perry
replies disabled

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