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!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-ID: <1197830.UlmGAzoze6@linux1.krischik.com> From: Martin Krischik Subject: Re: Finding out minimal allocation unit Newsgroups: comp.lang.ada Date: Sat, 07 Apr 2007 11:27:29 +0200 References: <20070403144350.6c95e085@cube.tz.axivion.com> <1175606570.4684.11.camel@localhost> <461257ea$1@news.post.ch> <4ecea2f308sbellon@sbellon.de> <55996242.eObHiMcIUq@linux1.krischik.com> <4ecee38d97sbellon@sbellon.de> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 84.73.230.248 (84.73.230.248) NNTP-Posting-Date: Sat, 07 Apr 2007 11:30:03 +0200 X-Trace: 107134617649bf1ec435d01689 Xref: g2news1.google.com comp.lang.ada:14828 Date: 2007-04-07T11:27:29+02:00 List-Id: Stefan Bellon wrote: > Martin Krischik wrote: > >> First we need to know which platform you are using (compiler/OS). > > GNAT on GNU/Linux, Windows and Solaris, where the memory allocation > should work well on all three of them (but using separates or package > Naming in a project file to supply different algorithms for the > allocation strategy is no problem). The GNAT default storrage pool just calls malloc and free from the C libraries - which explains the overhead. >> Then: how a storrage pool get's it memory is up to the pool designer. > >> In your case you could allocate a large chuck of memory strait from >> the OS and then sub-allocate it using an algorithm optimised for your >> needs. > > When using storage pools, can the storage pools be dynamically resized, > or is a storage pool, once created, fixed in its size? The latter would > rule out using storage pools since we do not know in advance how many > data we need to store, just the "Item_Type" is known when instantiating > the data structure, so it's size is known (provided we can trust the > 'Size, 'Object_Size, and 'Component_Size attributes). Whatever you implement. Other posters allready suggested a linked list of arrays which seems the best approach for a variable amount of fixed sized elements. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com