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!news2.google.com!news.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Finding out minimal allocation unit Date: Tue, 10 Apr 2007 17:42:57 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: 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> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1176241378 23600 192.74.137.71 (10 Apr 2007 21:42:58 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 10 Apr 2007 21:42:58 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:vFMBsrVEv4vwOKnjxSgfoIWq8Hg= Xref: g2news1.google.com comp.lang.ada:14895 Date: 2007-04-10T17:42:57-04:00 List-Id: Stefan Bellon writes: > 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). You can probably use storage pool code that is entirely portable to these three systems. If you need to use OS-specific things like mmap and VirtualAlloc, you can isolate those parts, but in your case, it's probably not necessary. >> 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? User-defined storage pools are entirely programmable. You write the code. You make it do whatever you like. If you want dynamically-resizable pools, then write the Allocate procedure to dynamically resize when needed. >... 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). You need to look up the 'Max_Size_In_Storage_Elements attribute, which is more relevant to storage pools. If your types are not unconstrained arrays or discriminated records, then the "Max_" size is probably the only size. - Bob