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,419864ed91cc937d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: System.Pool_Local.Unbounded_Reclaim_Pool (Was: heap size exceeded for large matrices) 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: <14007b1b-c290-4c73-a0ec-d3c5195b83d4@t20g2000yqa.googlegroups.com> <4c7a360b$0$10227$ba4acef3@reader.news.orange.fr> <340c87af-1f15-4590-baa9-ec7e864b7048@l20g2000yqm.googlegroups.com> <4c7ada3c$0$2372$4d3efbfe@news.sover.net> <7bol761eas8q6evpsar3kbu57fnihm7q3k@4ax.com> <8c2e3800-9f6b-4a16-a8a6-e0aa9eeb13fe@h19g2000yqb.googlegroups.com> <87hbicgsor.fsf_-_@hugsarin.sparre-andersen.dk> Date: Mon, 30 Aug 2010 15:38:55 +0200 Message-ID: NNTP-Posting-Date: 30 Aug 2010 15:38:54 CEST NNTP-Posting-Host: bf6225a8.newsspool4.arcor-online.net X-Trace: DXC=k:\[J6e`9gRAX0F2i> On Mon, 30 Aug 2010 15:01:56 +0200, Jacob Sparre Andersen wrote: > Cyrille writes: > >> If you want this behavior (i.e. deallocation of your dynamically >> allocated object on scope exit) you can explicitly associate the local >> access type to a pool object of type >> System.Pool_Local.Unbounded_Reclaim_Pool. > > Checking on Google indicates that this is a GNAT specific package. > > Are there any special reasons that the RM doesn't include a collection > of "useful" storage pool types like this one? There is even more important thing about pools missing: there is no name for the default storage pool. Let I have some specialized pools, which serves the purpose of allocation policy rather than actually providing storage. Such a pool sits on top of another pool. E.g. a mark and release pool uses another pool to allocate its blocks there. Other examples are stack pool, doubly-linked lists of non-tagged elements, graphs etc. The problem is that there is no way specify this default pool, because it has no name. In order to get at it I need to use tricks like: type Integer_Access is access Integer; -- Hopefully it is the default pool and then use Integer_Access'Storage_Pool. There is no any guaranty that this would work. P.S. It is clear that some compiler might use several default storage pools, e.g. special pools for allocating objects of according to their sizes. But that is no reason for not providing a default storage pool in addition to them, which would work for any object. P.P.S. There also should be a pragma or for-clause to re-route all other default pools to some pool. E.g. to a debugging pool. GNAT has a debugging pool but it is very difficult to use, because you have to rewrite all declarations of specific access types. That should rather be: for System.Default_Pool use My_Debugging_Pool; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de