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,FREEMAIL_FROM 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!news4.google.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Finding out minimal allocation unit Date: Fri, 06 Apr 2007 18:17:27 +0100 Organization: Pushface Message-ID: References: <20070403144350.6c95e085@cube.tz.axivion.com> <1175606570.4684.11.camel@localhost> <461257ea$1@news.post.ch> <4ecea2f308sbellon@sbellon.de> <4ecee3fe5esbellon@sbellon.de> <4ecf319357sbellon@sbellon.de> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1175879847 5251 62.49.19.209 (6 Apr 2007 17:17:27 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 6 Apr 2007 17:17:27 +0000 (UTC) Cancel-Lock: sha1:0iKOlmfjowlWskLMbIaHBAZ6Dfw= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (darwin) Xref: g2news1.google.com comp.lang.ada:14816 Date: 2007-04-06T18:17:27+01:00 List-Id: Stefan Bellon writes: > 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. I have a feeling that generics were problematic when I tried something like this -- but you can always use a constraint: with System.Storage_Pools; with System.Storage_Elements; package BC.Support.Managed_Storage is pragma Elaborate_Body; package SSE renames System.Storage_Elements; package SSP renames System.Storage_Pools; type Pool (Chunk_Size : SSE.Storage_Count) is new SSP.Root_Storage_Pool with private; from the Booch Components (this particular pool has a bug filed against it at the moment, caused by a perceived need to allocate variously-sized items from within large chunks and the resulting need to chain the free list through chunks ...)