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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news.glorb.com!newsfeed-0.progon.net!progon.net!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Finding out minimal allocation unit Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <20070403144350.6c95e085@cube.tz.axivion.com> Date: Tue, 3 Apr 2007 18:45:59 +0200 Message-ID: <1ro1hy9egg3wk.4vh8fmzc8a5w$.dlg@40tude.net> NNTP-Posting-Date: 03 Apr 2007 18:45:33 CEST NNTP-Posting-Host: afea4bab.newsspool3.arcor-online.net X-Trace: DXC=_=<=FE\HOLB78PK[oJ2ng@McF=Q^Z^V3H4Fo<]lROoRAFl8W>\BH3YBYd@R On Tue, 3 Apr 2007 14:43:50 +0200, Stefan Bellon wrote: > In a few places we are using long lists of items. Those items mostly > consist of just a pointer or a record of two pointers. We need cheap > insertions and deletions of elements in those lists, therefore we > indeed used linked lists and no array solution. If size is an issue, you can also use indices instead of access types. Provided that all items have same size. Then you split your list of records into lists of fields. type Index is mod ...; type Item_List is array (Index) of Item; pragma Pack (Item_List); type Previous is array (Index) of Index; pragma Pack (Previous); type Next is array (Index) of Index; pragma Pack (Next); First_Free : Index := ...; -- The list of free items (empty) First_In : Index := ...; -- The list (empty) Non_Yet_Visited : Index := ...; -- To avoid initialization of the list of free items You can avoid memory allocation in advance if you segment the arrays above and split Index into (Segment_No, In_Segment) pair. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de