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,6c43f45c2ab47c51 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Using Ada.Containers.Vector and Limited Private types 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: <8ff4c6c2-9892-463e-bdfd-1f7bfd78d607@s50g2000hsb.googlegroups.com> Date: Sun, 6 Jul 2008 21:18:17 +0200 Message-ID: NNTP-Posting-Date: 06 Jul 2008 21:18:21 CEST NNTP-Posting-Host: 6001b292.newsspool4.arcor-online.net X-Trace: DXC=VHNHe97@63A0YVY]kmLTlD4IUK\BH3YB\LY\2Z9V>?FDNcfSJ;bb[EIRnRBaCdTo]ML6lX@ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:1029 Date: 2008-07-06T21:18:21+02:00 List-Id: On Sun, 6 Jul 2008 11:09:58 -0700 (PDT), Gene wrote: > You'll need to allocate a fresh directory entry to "fill in" with each > call to Get_Next_Entry, as George suggested. I think it is not a good idea to have collections of Directory_Entry_Type. Depending on the implementation, Directory_Entry_Type might use some system resources, locked until Directory_Entry_Type finalization. > I believe that declaring the pointer type as "access" rather than > "access all" will cause the allocated entries to be automatically > freed with the storage pool when the procedure exits. Yes, storage pools is an excellent tool to construct containers of limited objects. It is a pity that Ada.Containers does not use this opportunity. Another solution, used in the Simple components, is to have specialized containers of pointers. The container becomes responsible to free pointed elements upon removal or replacing. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de