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,81633e7277ffacee X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed.kamp.net!newsfeed.kamp.net!feeder.news-service.com!news.albasani.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada containers and custom allocators Date: Mon, 7 Jan 2008 19:54:56 -0600 Organization: Jacob's private Usenet server Message-ID: References: <472f2c87-1238-42a5-8b94-92e9b70981da@f47g2000hsd.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1199757305 28640 69.95.181.76 (8 Jan 2008 01:55:05 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 8 Jan 2008 01:55:05 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:19263 Date: 2008-01-07T19:54:56-06:00 List-Id: "Maciej Sobczak" wrote in message news:472f2c87-1238-42a5-8b94-92e9b70981da@f47g2000hsd.googlegroups.com... > Hi, > > Is it possible to set up a custom allocator for use with any given Ada > container? If you mean an allocator for the private data of the container (which includes all of the elements and is the bulk of the container), the answer is no. The standard Ada containers do not provide any mechanism to control how/were the container allocates memory. We've discussed whether it would be possible to change that (perhaps by including a Storage_Pool parameter to the instantiation), but that would be (a) rather inconvenient, as there is no name for the standard storage pool, and there was substantial opposition to defining one; (b) very constraining on implementations, as the allocation behavior of the container would have to be fairly strongly defined in order for this to be useful (or, the storage pool passed would have to be completely general, allowing any size allocation, which would eliminate the vast majority of interesting things that you can do with storage pools). Thus, it seems more valuable to have bounded forms for which all of the allocation can be part of the container object, in which case a regular access type and allocator would do the trick. There is a project to define those in the works, but it hasn't been making a lot of progress. Randy.