comp.lang.ada
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: Custom Storage Pool questions
  @ 2021-09-20 16:59  7%         ` Shark8
  0 siblings, 0 replies; 4+ results
From: Shark8 @ 2021-09-20 16:59 UTC (permalink / raw)


On Monday, September 20, 2021 at 12:48:21 AM UTC-6, briot.e wrote:
> > > If a compiler is allowed to break up an allocation into multiple 
> > > calls to Allocate (and of course Deallocate), how does one go about 
> > > enforcing that the user's header is only created once? 
> > I think one cannot enforce that, because the calls to Allocate do not 
> > indicate (with parameters) which set of calls concern the same object 
> > allocation.
> I think the only solution would be for this compiler to have another attribute similar to 'Storage_Pool, but that would define the pool for the descriptor: 
> 
> for X'Storage_Pool use Pool; 
> for X'Descriptor_Storage_Pool use Other_Pool; 
> 
> That way the user can decide when to add (or not) extra headers.
Hmmm, smells like a place to use generics and subpools; perhaps something like:

Generic
   Type Element(<>) is limited private;
   Type Descriptor(<>) is limited private;
   with Create( Item : Element ) return Descriptor;
Package Descriptor_Subpool is
   Type Pool_Type is new System.Storage_Pools.Subpools.Root_Storage_Pool_With_Subpools with private;
Private
   -- Element-subpool & descriptor-subpool defined here.
   -- Allocation of element also allocates Descriptor.
End Descriptor_Subpool;

Just top-of-the-head musings though.

^ permalink raw reply	[relevance 7%]

* ANN: Deepend 3.4 Storage Pools
@ 2014-09-08  1:27  5% Brad Moore
  0 siblings, 0 replies; 4+ results
From: Brad Moore @ 2014-09-08  1:27 UTC (permalink / raw)


I am pleased to announce the availability of Deepend version 3.4.

Deepend is a suite of dynamic storage pools with subpool capabilities
for Ada 95, Ada 2005, and Ada 2012.
Bounded and unbounded storage pools types are provided.
Storage pools with subpool capabilities allow all objects in a subpool
to be reclaimed all at once, instead of requiring each object to be
individually reclaimed one at a time. Deepend storage pools provides a 
more efficient and safer scheme for storage management than relying on
the standard storage pool, and user calls to Unchecked_Deallocation.
In fact, Deepend can eliminate the need for Unchecked_Deallocations.
A Dynamic Pool may have any number of subpools.

Deepend can be downloaded from;
     https://sourceforge.net/projects/deepend/files/

Differences since last release include;

This is technically the first version of Deepend that compiles for Ada 
2012 and the GNAT GPL 2014 version of the compiler. In particular,

- The Pool parameter of the
   System.Storage_Pools.Subpools.Default_Subpool_For_Pool function was
   finalized to be an in out parameter for the Ada 2012 standard.
   This requires changes to the Deepend pools, since they override this
   function. In addition, the Ada 2005 and Ada 95 versions of Deepend
   also were modified to reflect this change. In Ada 95 and Ada 2005,
   functions cannot have in out parameters, so instead, the parameters
   were changed to be access parameters, so that the Ada 95 and Ada 2005
   version more closely matches the Ada 2012 version.
- In the Ada 2012 version, there were static_predicates defined for
   private declarations, which in fact needed to be dynamic_predicates.
   Since these were private declarations, the predicates were removed,
   since they weren't very useful since they were private declarations,
   and the need for dynamic checks for this was deemed as worthwhile.
- Removed workarounds for GNAT compiler bugs that were fixed in the
   GNAT GPL 2014 version of the compiler. In particular, the storage
   pools have default discriminants which now can be left unspecified
   to use the defaults.

Regards,
    Brad Moore


















^ permalink raw reply	[relevance 5%]

* ANN: Deepend 3.0 Available for Ada 2012 and Ada 2005
@ 2012-07-04 15:04  6% Brad Moore
  0 siblings, 0 replies; 4+ results
From: Brad Moore @ 2012-07-04 15:04 UTC (permalink / raw)


I am pleased to announce the availability of Deepend 3.0.

Deepend is a dynamic storage pool with Subpool capabilities for Ada 2005
and Ada 2012 where all the objects in a subpool can be reclaimed all at
once, instead of requiring each object to be individually reclaimed one
at a time. A Dynamic Pool may have any number of subpools. If subpools
are not reclaimed prior to finalization of the pool, then they are
finalized when the pool is finalized.

Rather than deallocate items individually which is error prone and
susceptible to memory leaks and other memory issues, a subpool can be
freed all at once automatically when the pool object goes out of scope.

With this Storage pool, Unchecked_Deallocation is implemented as a No-Op
(null procedure), because it is not needed or intended to be used.

Subpool based storage management provides a safer means of memory
management, which can outperform other mechanisms for storage
reclamation including garbage collection.

Major differences in this release:

- Ada 2012 version is available which utilizes the new 
System.Storage_Pools.Subpools package defined in the Ada2012 standard.

- Ada 2012 version allows objects of unconstrained types, and objects 
that need finalization such as protected objects and controlled types
to be allocated to subpools. These objects are properly finalized when
the subpool is deallocated.

- Ada 2012 version uses other new features of the language, including
   in out parameters for function calls instead of access parameters,
   and provides a default discriminant for the Dynamic_Pool type. Pre
   and Post conditions are also used.

- The Storage_Size primitive is now implemented so that it reports the
amount of storage currently used

- The Binary_Tree benchmark that uses access type finalization was 
updated to use the Basic_Dynamic_Pools package instead of the 
Dynamic_Pools package, since that particular test does not use subpools.

The latest stable release and older releases may be downloaded from;

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



^ permalink raw reply	[relevance 6%]

* Is Storage Subpool Example tested?
@ 2012-04-25 21:18  6% ytomino
  0 siblings, 0 replies; 4+ results
From: ytomino @ 2012-04-25 21:18 UTC (permalink / raw)


Hello.

I'm trying to compile http://ada-auth.org/standards/12rm/html/RM-13-11-6.html , but there are some errors.

Perhaps, 

1. "use type System.Storage_Pools.Subpools.Subpool_Handle;" is missing.

2. 2nd parameter of Set_Pool_of_Subpool is "in out", but access value is given.

3. Downcast as MR_Subpool is missing in
> Result.Start := Pool.Next_Allocation;

4. ".Start" is missing in
> Pool.Next_Allocation := Pool.Markers(Pool.Current_Pool);

(And, I had to replace some 'Unchecked_Access to 'Unrestricted_Access, but this is GNAT's feature. I don't care it.)

BTW, Do you have a interesting idea to use subpools?
For instance, I like Matthew Heaney's System.Initialization. ( http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0001-1.txt?rev=1.17 )
It seems to be able to implement by user with subpool.

 P := System.Initialization.New_Object (Storage);

is able to be rewritten like below

 P := new (Make_Subpool_Using_Given_Address (Storage'Address)) Object_Type;

However, Delete_Object is difficult. :-)



^ permalink raw reply	[relevance 6%]

Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-04-25 21:18  6% Is Storage Subpool Example tested? ytomino
2012-07-04 15:04  6% ANN: Deepend 3.0 Available for Ada 2012 and Ada 2005 Brad Moore
2014-09-08  1:27  5% ANN: Deepend 3.4 Storage Pools Brad Moore
2021-09-13  0:53     Custom Storage Pool questions Jere
2021-09-13  5:29     ` Randy Brukardt
2021-09-20  0:31       ` Jere
2021-09-20  6:34         ` Niklas Holsti
2021-09-20  6:48           ` Emmanuel Briot
2021-09-20 16:59  7%         ` Shark8

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