comp.lang.ada
 help / color / mirror / Atom feed
From: Stefan Bellon <sbellon@sbellon.de>
Subject: Re: Finding out minimal allocation unit
Date: Fri, 06 Apr 2007 10:10:17 +0200
Date: 2007-04-06T10:10:17+02:00	[thread overview]
Message-ID: <4ecf319357sbellon@sbellon.de> (raw)
In-Reply-To: ev47r2$odv$1@jacob-sparre.dk

Randy Brukardt wrote:
> "Stefan Bellon" <sbellon@sbellon.de> wrote in message

> > a) we can resize an already existing storage pool to increase the
> > memory inside it, and

> It's whatever you want it to be! A storage pool is just a container
> that is automatically called when you allocate or deallocate memory.
> There of course are the predefined ones, but you can provide your own
> about which you define *all* of the details.

Ok, that sounds gook.

> In your case, I'd probably implement the pool as a linked list of
> arrays that hold enough elements for some large size (at least 4K for
> Windows, can't say for Linux). And then I'd manage them with a free
> chain and a pass through for unusual sizes (see below). You could
> even set the item size as a discriminant of the pool type, possibly
> using the attribute designed for this purpose
> ('Max_Size_in_Storage_Elements).

Well, our idea was to build a generic storage pool which can handle
only memory chunks of one size. And the generic storage pool is
instantiated with that size as generic parameter. So that each data
structure instance (be it a list, a tree, hash table, ...) has its own
storage pool with the exact Item_Type'Size instantiated.

> Indeed, I have a pool whose job was to find the source of dangling
> pointers, and all it did was save the pointers and clobber memory on
> deallocation; the actual allocation was a pure pass-through to the
> standard pool (using New and Unchecked_Deallocation).

Cool idea!

> I suggest reading up on storage pools in whatever you can find.

Ok, thanks for all the help and ideas so far!

-- 
Stefan Bellon



  reply	other threads:[~2007-04-06  8:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03 12:43 Finding out minimal allocation unit Stefan Bellon
2007-04-03 13:22 ` Georg Bauhaus
2007-04-03 13:28   ` Stefan Bellon
2007-04-03 13:34   ` Martin Krischik
2007-04-03 13:37     ` Stefan Bellon
2007-04-03 15:17       ` Markus E Leypold
2007-04-04 17:16         ` Robert A Duff
2007-04-05  8:55           ` Markus E Leypold
2007-04-05 17:55             ` Stefan Bellon
2007-04-06  1:40               ` Randy Brukardt
2007-04-06  8:06                 ` Stefan Bellon
2007-04-06 11:06                   ` Markus E Leypold
2007-04-03 23:53     ` Randy Brukardt
2007-04-05  6:12       ` Stefan Bellon
2007-04-05  7:35         ` Martin Krischik
2007-04-05 17:58           ` Stefan Bellon
2007-04-07  9:27             ` Martin Krischik
2007-04-10 21:42             ` Robert A Duff
2007-04-05 13:07         ` Robert A Duff
2007-04-05 18:02           ` Stefan Bellon
2007-04-06  1:31             ` Randy Brukardt
2007-04-06  8:10               ` Stefan Bellon [this message]
2007-04-06 17:17                 ` Simon Wright
2007-04-06 12:38         ` Stephen Leake
2007-04-03 14:12   ` Larry Kilgallen
2007-04-03 13:48 ` Robert A Duff
2007-04-03 16:45 ` Dmitry A. Kazakov
replies disabled

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