comp.lang.ada
 help / color / mirror / Atom feed
* Re: object allocation: Mach, zones, ADA and C++
       [not found] <GBOL.95Feb19102202@custard.think.com>
@ 1995-02-23 10:27 ` Robb Nebbe
  0 siblings, 0 replies; only message in thread
From: Robb Nebbe @ 1995-02-23 10:27 UTC (permalink / raw)


In article <GBOL.95Feb19102202@custard.think.com>,
gbol@custard.think.com (Gregory Lampshire) writes:

The problem:

|> I want to allocate an object and other record members of that object from
|> the same zone under a Mach based operating system. ...
 
|> I would like to use zone based allocation in Ada for objects (and more
|> importantly, tagged objects) but it is not clear how to control the
|> allocation at the level that I wish.  


proposed C++ solution:

|> Under C++, I would define a class
|> member function ``new'' which allows me to control which zone to use.  For
|> example in C++, I could define
|> 
|> void* T::operator new(size_t n, Zone z)
|> 
|> and do a
|> 
|> t = new(zone(s)) T;

I really don't see any difficulty in doing this in Ada but I don't
have enough information to suggest a complete solution.

What is the correspondance between zones and memory pools and why?

You seem to imply that you would naturally use one memory pool per
zone. In this case you write a function that takes a zone parameter
and allocates an object, returning a general access type to the
object.

If zones all share the same address space a better solution might
be dividing a single memory pool into different zones. You could
add an operation that returns the zone to which a access type
provides access and implement this in the pool rather than in each
object.

If zones are something important in Mach a zoned_pool type might
make a lot of sense from a reusability point of view.

I don't understand the problem well enough so I'm just guessing but
if you want to provide more information I'd be happy to continue
guessing :-)

Robb Nebbe



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-02-23 10:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <GBOL.95Feb19102202@custard.think.com>
1995-02-23 10:27 ` object allocation: Mach, zones, ADA and C++ Robb Nebbe

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