From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,427e29f23a651ddb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Stefan Bellon Newsgroups: comp.lang.ada Subject: Re: Finding out minimal allocation unit Date: Fri, 06 Apr 2007 10:10:17 +0200 Organization: University of Stuttgart Message-ID: <4ecf319357sbellon@sbellon.de> References: <20070403144350.6c95e085@cube.tz.axivion.com> <1175606570.4684.11.camel@localhost> <461257ea$1@news.post.ch> <4ecea2f308sbellon@sbellon.de> <4ecee3fe5esbellon@sbellon.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1175847020 00 25774 aULC6kKr0TkA11r 070406 08:10:20 X-Complaints-To: usenet-abuse@t-online.de X-ID: res0q0ZZweecgiuIhUWr9lpOREOMDzkV2hG5TBW-3Y1UYjjHex3T43 User-Agent: Pluto/3.04c (RISC-OS/5.11) NewsHound/v1.50-32 X-Request-PGP: http://www.sbellon.de/gpg.asc X-PGP-ID: 05360CB9 / 55DB 48FE BA59 7BA0 2B9D 4822 38C5 EC21 0536 0CB9 X-URL: http://www.sbellon.de/ Xref: g2news1.google.com comp.lang.ada:14807 Date: 2007-04-06T10:10:17+02:00 List-Id: Randy Brukardt wrote: > "Stefan Bellon" 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