comp.lang.ada
 help / color / mirror / Atom feed
* Re: Allocation from storage pools
  1999-06-28  0:00 Allocation from storage pools Andy Askey
@ 1999-06-28  0:00 ` Jeffrey D. Cherry
  1999-06-29  0:00 ` JClezy
  1999-07-01  0:00 ` Andy Askey
  2 siblings, 0 replies; 5+ messages in thread
From: Jeffrey D. Cherry @ 1999-06-28  0:00 UTC (permalink / raw)


Andy,

There are some fine examples of memory management in the Booch
components at
     http://www.pogner.demon.co.uk/components/bc
Review the bounded versions for a possible match with your goals.  You
can always write your own memory manager to limit the total memory used
for a group of objects.  Once again the Booch components will give you a
place to start if this becomes necessary.

Regards,
Jeffrey D. Cherry
Logicon Space and Information Operations
Logicon, Inc.
a Northrop Grumman Company




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Allocation from storage pools
@ 1999-06-28  0:00 Andy Askey
  1999-06-28  0:00 ` Jeffrey D. Cherry
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Askey @ 1999-06-28  0:00 UTC (permalink / raw)


I am trying to figure out the best method (most efficient-least runtime
hit) to allocate/deallocate memory to dynamic objects.  Here is what I
want to do, in general:

1) Grab a chunk of memory during program initialization to serve as a
dynamic allocation pool for subsequent object memory allocation.

2) Allocate new objects (various types) from the previous allocated
chunk of memory.  I'd like to do something like this:

  newobj := new newobj_type; (or some form like that, not necessarily
overloading new, that grabs memory from the chunk)

3) Deallocate the objects when I am done with in (freeing up the memory
from the big chunk).

I am developing in Apex Ada95 on a Solaris OS.  I found some
documentation about this in
System.Storage_Pools.Rational.Storage_Pools.  I do not really want to
use something that is Apex specific.

My questions:

Does Ada95 give me anything I can use to implement 1,2,&3 above?  I can
write my own code fairly easily to do this, but I want to take advantage
of anything already provided by Ada95.

Any help on this topic will be greatly appreciated.

Thanx.
Andy

-- 
---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Allocation from storage pools
  1999-06-28  0:00 Allocation from storage pools Andy Askey
  1999-06-28  0:00 ` Jeffrey D. Cherry
@ 1999-06-29  0:00 ` JClezy
  1999-06-29  0:00   ` Jeffrey D. Cherry
  1999-07-01  0:00 ` Andy Askey
  2 siblings, 1 reply; 5+ messages in thread
From: JClezy @ 1999-06-29  0:00 UTC (permalink / raw)


>I am trying to figure out the best method (most efficient-least runtime
>hit) to allocate/deallocate memory to dynamic objects.  Here is what I
>want to do, in general:
>
>1) Grab a chunk of memory during program initialization to serve as a
>dynamic allocation pool for subsequent object memory allocation.
>
>2) Allocate new objects (various types) from the previous allocated
>chunk of memory.  I'd like to do something like this:
>
>  newobj := new newobj_type; (or some form like that, not necessarily
>overloading new, that grabs memory from the chunk)
>
>3) Deallocate the objects when I am done with in (freeing up the memory
>from the big chunk).
>
>I am developing in Apex Ada95 on a Solaris OS.  I found some
>documentation about this in
>System.Storage_Pools.Rational.Storage_Pools.  I do not really want to
>use something that is Apex specific.
>
>My questions:
>
>Does Ada95 give me anything I can use to implement 1,2,&3 above?  I can
>write my own code fairly easily to do this, but I want to take advantage
>of anything already provided by Ada95.
>

I dont know if this will help but Ada 83 & 95 provided private memory pools. I
cant remember the exact syntax however in essence you specify the amount of
storage to be used for a private pool for a particular access type. When an
object is created via new the memory is taken from the private pool not the
heap. This would require you to create a private pool for each access type.
This is briefly covered in Barnes somewhere.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Allocation from storage pools
  1999-06-29  0:00 ` JClezy
@ 1999-06-29  0:00   ` Jeffrey D. Cherry
  0 siblings, 0 replies; 5+ messages in thread
From: Jeffrey D. Cherry @ 1999-06-29  0:00 UTC (permalink / raw)


Barnes, "Programming in Ada95", 2nd edition, chapter 21, section 4.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Allocation from storage pools
  1999-06-28  0:00 Allocation from storage pools Andy Askey
  1999-06-28  0:00 ` Jeffrey D. Cherry
  1999-06-29  0:00 ` JClezy
@ 1999-07-01  0:00 ` Andy Askey
  2 siblings, 0 replies; 5+ messages in thread
From: Andy Askey @ 1999-07-01  0:00 UTC (permalink / raw)


Thanx for the info.  The Booch URL and the Barnes references were
exactly what I was looking for.

Andy

Andy Askey wrote:
> 
> I am trying to figure out the best method (most efficient-least runtime
> hit) to allocate/deallocate memory to dynamic objects.  Here is what I
> want to do, in general:
> 
> 1) Grab a chunk of memory during program initialization to serve as a
> dynamic allocation pool for subsequent object memory allocation.
> 
> 2) Allocate new objects (various types) from the previous allocated
> chunk of memory.  I'd like to do something like this:
> 
>   newobj := new newobj_type; (or some form like that, not necessarily
> overloading new, that grabs memory from the chunk)
> 
> 3) Deallocate the objects when I am done with in (freeing up the memory
> from the big chunk).
> 
> I am developing in Apex Ada95 on a Solaris OS.  I found some
> documentation about this in
> System.Storage_Pools.Rational.Storage_Pools.  I do not really want to
> use something that is Apex specific.
> 
> My questions:
> 
> Does Ada95 give me anything I can use to implement 1,2,&3 above?  I can
> write my own code fairly easily to do this, but I want to take advantage
> of anything already provided by Ada95.
> 
> Any help on this topic will be greatly appreciated.

---------------------------------------------------
|                 Andy Askey                      |
|              Software Engineer                  |
|           Raytheon Systems Company              |
|   670 Discovery Drive, Huntsville, AL  35806    |
|   Phone: (256) 971-2367  Fax: (256) 971-2306    |
|        andrew_j_askey@res.raytheon.com          |
---------------------------------------------------




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-07-01  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-28  0:00 Allocation from storage pools Andy Askey
1999-06-28  0:00 ` Jeffrey D. Cherry
1999-06-29  0:00 ` JClezy
1999-06-29  0:00   ` Jeffrey D. Cherry
1999-07-01  0:00 ` Andy Askey

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