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!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.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: Thu, 10 Jan 2008 23:00:04 -0600 Organization: Jacob's private Usenet server Message-ID: References: <472f2c87-1238-42a5-8b94-92e9b70981da@f47g2000hsd.googlegroups.com> <1rny29vw3pipd$.oppchvpo4gnf$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1200078069 26973 69.95.181.76 (11 Jan 2008 19:01:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 11 Jan 2008 19:01:09 +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:19324 Date: 2008-01-10T23:00:04-06:00 List-Id: "Robert A Duff" wrote in message news:wcchchnc905.fsf@shell01.TheWorld.com... > "Dmitry A. Kazakov" writes: ... > > That always wondered me, why there is no name for. Especially because the > > default storage pool can be obtained anyway: > > > > type Some_Ptr is access Integer; -- Goes to the default storage pool > > package Foo is new Boo (Some_Ptr'Storage_Pool); > > The compiler is not required to use the same storage pool for all > types. Therefore, the concept "THE default pool" does not exist. > > Some_Ptr'Storage_Pool might be a special pool tuned for the fact that > Size_In_Storage_Elements = 4 and Alignment = 4. Allocate could > add 4 to a known-aligned pointer, and ignore the > Size_In_Storage_Elements and Alignment parameters. > > If Boo uses this pool for something other than Integer, > it might not work. Right. And it turns out that some commonly used compilers actually do use different pools in different circumstances. (I think the mechanism had to do with the nesting level of the access type declaration; I recall that we discussed it in detail.) The net effect is that in some existing implementations, there is no general pool. It didn't make much sense to force them to change to a more general model that could introduce storage leaks in existing programs, and thus there is (still) no name for the standard pool. Randy. > However, I see nothing wrong with having a predefined operation that > returns a suitable pool. > > - Bob